Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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.

— asked September 16th 2010 by Matt Bell
  • android notifications
0 Comments

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

    — answered February 16th 2011 by Alastair C
    permalink
    0 Comments
  • 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.

    — answered September 17th 2010 by Matt Bell
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.