I have a button that should change the activity when it is tapped. It does so, but if it is double-tapped instead, the app closes and returns to the app picker screen. When I reopen the app, it appears to have performed the button press, because the other activity is open.
The output that I'm getting after the double tap is:
D/EGL_emulation: eglMakeCurrent: 0xe8404120: ver 3 1 (tinfo 0xe8403710)
W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@9636f2c
D/EGL_emulation: eglMakeCurrent: 0xe8404120: ver 3 1 (tinfo 0xe8403710)
D/OpenGLRenderer: endAllActiveAnimators on 0xe5939f80 (RippleDrawable) with handle 0xdf318510
I have done a bunch of debugging, while simultaneously learning about activity lifecycles and such, but the latest stuff I've done is below...
I took everything out of the onCreate() of the new activity besides these two lines, and it did the same thing.
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settings);
Then, I tried removing the setContentView line as well, and it was significantly harder to double click fast enough to make it "crash".
This is the code that should launch the activity when the button is pressed:
//Disable interval and start buttons to prevent multiple activities from loading
Button i = (Button) view;
Button s = findViewById(R.id.startButton);
i.setEnabled(false);
s.setEnabled(false);
try {
Intent settingsActivityIntent = new Intent(this, SettingsActivity.class);
startActivity(settingsActivityIntent);
} catch(Error error) {
Log.println(Log.DEBUG,"debug", "*****************************");
Log.println(Log.DEBUG,"debug",error.toString());
}
I'll appreciate any ideas regarding why this could happen. Thank you!