When I paused my app I am calling this function and getting notification successfully. But when I click notification my app is restarting. I would like show my app again instead of restart. is it possible?
function $FncSendLocalNotification($QsContentTitle, $QsContentText, $QsId) {
if (OS_ANDROID) {
$FncTiApiInfo("Local notification fired for Id: " + $QsId);
//> Intent object to launch the application
var $Intent = Ti.Android.createIntent({
action : Ti.Android.ACTION_MAIN,
//> Substitute the correct class name for your application
className : 'com.myapp.test.testActivity',
//> Substitue the correct package name for your application
packageName : Ti.App.id
});
$Intent.flags |= Ti.Android.FLAG_ACTIVITY_CLEAR_TOP | Ti.Android.FLAG_ACTIVITY_NEW_TASK;
$Intent.addCategory(Ti.Android.CATEGORY_LAUNCHER);
//> 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({
//> icon is passed as an Android resource ID -- see Ti.App.Android.R.
//> platforms/android/res/drawable/my_icon.png
icon :Ti.App.Android.R.drawable.notification,
contentTitle : $QsContentTitle,
contentText : $QsContentText,
contentIntent : $Pending
});
//> Send the notification
Titanium.Android.NotificationManager.notify($QsId, $Notification);
}
}
