Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add Buttons Above the Notifications Tab in the Status Bar

Tags:

android

I am developing an Android app that will run as a service most of the time. The user would be able to control it via the status bar -- including the ability to stop the service altogether.

Even though I am able to make a custom view and put buttons on the Notifications area [see Figure 1], I would like to be able to put it above the "Android"/Service Provider's name. Much in the same way as the Music Player app does this [see Figure 2]. That way, even if the user clears their notifications, my app's control panel will remain active as long as the service is running.

What's the best way to do that, please?

Figures 1 and 2

Original Image Link

like image 755
ilyakam Avatar asked Dec 17 '10 03:12

ilyakam


1 Answers

Your ROM has hidden the Ongoing header; both the Music player and the hardware control widget use the ONGOING_EVENT flag to remain where they are (someone correct me if I'm wrong). Confirm this by loading your app onto your patched phone - the documentation specifically names e.g. Music players (and other times your process is still going on in the background) as times when you should use this flag.

You might like to note that the same page recommends the FLAG_NO_CLEAR flag - if all you want is for it not to be cleared when the user clicks clear notifications (this is recommended for ongoing apps).

like image 131
jelford Avatar answered Sep 30 '22 20:09

jelford