I want to run alarm service for every second in my application.It is working fine below 5.1 version. but it is not triggering in 5.1 devices. I am using commonsware wa
Why would you do that?
Use an handler instead:
Runnable runnable = new Runnable() {
@Override
public void run() {
// do your stuff here, called every second
mHandler.postDelayed(this, 1000);
}
};
// start it with:
mHandler.post(runnable);
And use the following to stop your 1 sec timer:
mHandler.removeCallbacks(runnable);