[Solved] disable buttons permanently throughout the aplication in android


define the behavior in SharePreferences:

for example use this in onResume:

SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);
boolean enabled = pref.getBoolean("isEnabled",true);
myButton.setEnabled(enabled);

in onClick event of the button do this:

SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);
pref.edit().putBoolean("isEnabled",false).commit();
myButton.setEnabled(false);

2

solved disable buttons permanently throughout the aplication in android