Created
July 26, 2011 06:25
-
-
Save nowelium/1106112 to your computer and use it in GitHub Desktop.
Android Notification re-launching
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var activityClassName = Ti.App.id + '.' + Ti.App.name.substring(0, 1).toUpperCase() + Ti.App.name.substring(1) + 'Activity'; | |
var intent = Titanium.Android.createIntent({ | |
//className: 'org.appcelerator.titanium.TiActivity', | |
//packageName: Ti.App.id, | |
className: activityClassName, | |
action: Titanium.Android.ACTION_MAIN, | |
flags: 0x10200000 | |
}); | |
intent.addCategory(Titanium.Android.CATEGORY_LAUNCHER); | |
var pending = Titanium.Android.createPendingIntent({ | |
activity: Titanium.Android.currentActivity, | |
intent: intent, | |
//ype: Titanium.Android.PENDING_INTENT_FOR_ACTIVITY, | |
flasgs: 0x10200000 | |
}); | |
var notification = Titanium.Android.createNotification({ | |
// appicon | |
icon: 0x7f020000, | |
contentIntent: pending, | |
contentTitle: 'title is here', | |
contentText: 'text is here', | |
tickerText: 'ticket is here', | |
}); | |
Titanium.Android.NotificationManager.notify(1, notification); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this work even when app is paused?