Replaced resource ID switches by ifs

This commit is contained in:
M66B
2021-02-05 11:15:02 +01:00
parent b8662875f9
commit 3e41dd2e49
45 changed files with 1353 additions and 1623 deletions

View File

@@ -673,14 +673,12 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
onBackPressed();
return true;
default:
return super.onOptionsItemSelected(item);
if (item.getItemId() == android.R.id.home) {
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
onBackPressed();
return true;
}
return super.onOptionsItemSelected(item);
}
protected boolean backHandled() {