I want to achieve this :
- When alarm starts ringing the notification sound should play continuously until the user drag notification bar.
- When I drag down the notification bar the sound should stop playing.
I want to achieve this :
In notifications there are few flags that are used to stop notification automatically u have to use them those are.
2.Notification.FLAG_INSISTENT:this flag is makes your sound to ring continuously until you have done few operations on notification ie, either you drag the bar or you click the bar.
3.Notification.FLAG_AUTO_CANCEL:this flag is used to automatically cancel the notification after you have seen it
why the nastiness with reflection?
Because it is not part of the Android SDK. Only people interested in creating unreliable apps would try to interact with the StatusBarManager
outside of the Android source code itself. Since the core Android team and device manufacturers are welcome to change anything outside of the SDK whenever they wish.
Why can't I find a reference to the StatusBarManager class directly?
Because it is not part of the Android SDK. There are many great classes and methods in Android framework that are marked with the @hide annotation, for all sorts of reasons: unwillingness to commit to support the API indefinitely, "security by obscurity", etc.
Why is there not a constant in the Context class for the "statusbar" service?
Because it is not a part of the Android SDK. You are certainly welcome to supply patches to the AOSP to have StatusBarManager be "promoted" to same status as the other system services (e.g., LocationManager, NotificationManager). If the StatusBarManager situation is merely an oversight after the SDK was created in ~2007, your patches might well be accepted and you would see the changes in an upcoming version of Android.
Why can't I find a reference to the StatusBarManager class directly?