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?
Original Image Link
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With