I want to change some values onBackPressed method... And i override it like this:
@Override
public void onBackPressed() {
final Handler backHandler = new Handler();
backHandler.postDelayed(new Runnable() {
public void run() {
exitCount = 0;
Log.d("exitCount", "exitCount: " + exitCount);
}
}, Toast.LENGTH_SHORT);
}
But the problem is handler posts immediately... There's no delay. Where am i doing wrong? Sorry if this is a lame question, i'm pretty new on Android. Thanks in advance.