Afternoon all I need to call an intent and upon returning disable the button for X seconds. I have tried variations of the following, which either disable the button immediately and then enable or do not do what I need full stop.
Guarding.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Guarding.setEnabled(false);
SharedPref.write(SharedPref.SCANTYPE,"GUARDING");
Intent intent = new Intent(Menu.this, CmxScanner.class);
startActivity(intent);
Guarding.postDelayed(new Runnable() {
public void run() {
Guarding.setEnabled(true);
//Log.d(TAG,"resend1");
}
},10000);
}
});
So on first entry to the menu i have a button that is enabled, after clicking it must call the intent and upon returning disable the button again for X seconds. Before it will enable and allow a second request to the Intent