• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Android Handler remove callback

In my Application I am using handlers for showing alerts after sometime. I have used postdelayed() method for delay. I want to remove handler's callback
so how to check that handler has callback?

final Handler handler_Alerts = new Handler();
Runnable r_Alerts = new Runnable() {
public void run() {
Toast.makeText(getApplicationContext(), "In Handler", Toast.LENGTH_SHORT).show();
handler_Alerts.postDelayed(this, 1000);
}
};

handler_Alerts.postDelayed(r_Alerts, 1000);

Now I want to remove this handler's callback
 
Back
Top Bottom