Android Handler remove callback

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

Android Handler remove callback

Postby ashokk » Fri Jun 07, 2013 7:00 am

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 at other place in my code
ashokk
Once Poster
Once Poster
 
Posts: 1
Joined: Fri Jun 07, 2013 6:27 am

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 11 guests