Disable donate button after click

This commit is contained in:
M66B 2015-11-02 21:57:05 +01:00
parent e0ed06cc5f
commit b4abb2e727
1 changed files with 7 additions and 0 deletions

View File

@ -525,6 +525,11 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
@Override
public void onClick(View view) {
new AsyncTask<Object, Object, Object>() {
@Override
protected void onPreExecute() {
btnDonate.setEnabled(false);
}
@Override
protected Object doInBackground(Object... objects) {
try {
@ -553,6 +558,8 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
} catch (Throwable ex) {
Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
Toast.makeText(ActivityMain.this, result.toString(), Toast.LENGTH_LONG).show();
} finally {
btnDonate.setEnabled(true);
}
}
}.execute();