Android Ongoing Notifications
How can I implement Android's "ongoing notification" functionality in my app? I cannot find it in the API, so does this mean it is not possible (yet)?
My project requires the ability to be run and left in the background and easily be accessed to let the user check their status.
If this is not possible, how would I go about running the app in the background at all?
Thank you so much for your time, and I look forward to contributing to this community once I have mastered this platform.
3 Answers
-
I had the same issue, I found a solution. I'm not sure if it's documented anywhere, but you can pass a "flags" parameter into the createNotification, like so:
var notification = Ti.Android.createNotification({ tickerText: "Titanium Rocks!", icon: AppR.drawable.ti, contentTitle: "Titanium Rocks!", contentText: "Open a Javascript Activity", contentIntent: jsPendingIntent, flags: 2 });
This will create an "ongoing" notification, as specified in the flags section of these Android docs:
http://developer.android.com/reference/android/app/Notification.html
-
I am bumping this post because it is important to me that this is answered. I also hope the help in this thread will be of use to people finding this in the future.
-
Any one here can answer for my thread i raised here - http://developer.appcelerator.com/question/153257/android—show-download-progress-in-notification-bar-as-a-notification-along-with-progress-bar