android: MainActivity: Fix crash when game directory button is not present.
This commit is contained in:
parent
b6c91905cc
commit
6317c58897
@ -186,7 +186,9 @@ public final class MainActivity extends AppCompatActivity implements MainView {
|
||||
.commit();
|
||||
|
||||
// Immediately prompt user to select a game directory on first boot
|
||||
findViewById(R.id.button_add_directory).callOnClick();
|
||||
if (mPresenter != null) {
|
||||
mPresenter.launchFileListActivity();
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(this, R.string.write_permission_needed, Toast.LENGTH_SHORT)
|
||||
.show();
|
||||
|
@ -27,6 +27,12 @@ public final class MainPresenter {
|
||||
refeshGameList();
|
||||
}
|
||||
|
||||
public void launchFileListActivity() {
|
||||
if (mView != null) {
|
||||
mView.launchFileListActivity();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean handleOptionSelection(int itemId) {
|
||||
// Double-click prevention, using threshold of 500 ms
|
||||
if (SystemClock.elapsedRealtime() - mLastClickTime < 500) {
|
||||
@ -40,7 +46,7 @@ public final class MainPresenter {
|
||||
return true;
|
||||
|
||||
case R.id.button_add_directory:
|
||||
mView.launchFileListActivity();
|
||||
launchFileListActivity();
|
||||
return true;
|
||||
|
||||
case R.id.button_premium:
|
||||
|
Loading…
x
Reference in New Issue
Block a user