Problem description
There seem to be no intent extra when the app is using TabGroup. The extra data has been added to an intent that is run by a local notification.
Steps to reproduce
Try the following example:
var tabgroup = Ti.UI.createTabGroup();
var win = Ti.UI.createWindow({
backgroundColor: 'black'
});
var btn = Ti.UI.createButton({
title: 'Notify'
});
btn.addEventListener('click', function(e) {
// Intent object to launch the application
var intent = Ti.Android.createIntent({
flags : Ti.Android.FLAG_ACTIVITY_CLEAR_TOP | Ti.Android.FLAG_ACTIVITY_NEW_TASK,
className : 'com.appcelerator.davide.testapp.TestappActivity'
});
intent.addCategory(Ti.Android.CATEGORY_LAUNCHER);
intent.putExtra(Ti.Android.EXTRA_TEXT, "notification");
// Create a PendingIntent to tie together the Activity and Intent
var pending = Titanium.Android.createPendingIntent({
intent: intent,
flags: Titanium.Android.FLAG_UPDATE_CURRENT
});
// Create the notification
var notification = Titanium.Android.createNotification({
contentTitle: 'Something Happened',
contentText : 'Click to return to the application.',
contentIntent: pending
});
// Send the notification.
Titanium.Android.NotificationManager.notify(1, notification);
});
win.add(btn);
var tab = Ti.UI.createTab({
window: win,
title: 'Tab 1'
});
tabgroup.addTab(tab);
tabgroup.open();
tabgroup.addEventListener('open', function() {
tabgroup.getActivity().addEventListener('resume', function(e) {
var intent = e.source.intent;
Ti.API.info("intent: " + JSON.stringify(intent));
var notification = false;
if (intent.hasExtra(Ti.Android.EXTRA_TEXT) && (intent.getStringExtra(Ti.Android.EXTRA_TEXT) == "notification")) {
notification = true;
intent.putExtra(Ti.Android.EXTRA_TEXT, ""); // remove the EXTRA_TEXT once captured
}
if (notification == true) {
// operations to be performed when the app is open from the notification
alert('Coming from a notification');
} else {
alert('Just resumed the app');
}
});
})
The extra data seems to be always null
Waiting for further information from CS. resolving for now
Closing ticket as the information that was requested was never provided.