Android Activity onNewIntent
Is it planned to implement a callback for onNewIntent in an Android Activity?
1 Answer
-
I'm not quite sure to understand your question or what you are trying to do. But basically an activity eventListener might trap a newIntent whenever an Intent is received, please see an actual snippet code:
var activity = Ti.Android.currentActivity; var intent = activity.getIntent(); if (intent !== null) { Ti.API.info("Intent Hello: " + intent.getStringExtra("hello")); } else { Ti.API.info("No intent"); } activity.addEventListener('newIntent', function(e) { var msg = "NewIntent: No property."; if (e.intent) { msg = "NewIntent: property hello has value " + e.intent.getStringExtra("hello"); } Ti.UI.createNotification({ message : msg }).show(); });
If still needed by someone else please feel free to add remarks, just provided my 2 cents here …