Replaced if/else with switch
This commit is contained in:
parent
c12ac64678
commit
fc4dd4524a
|
@ -190,15 +190,16 @@ public class ErrorActivity extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(final MenuItem item) {
|
public boolean onOptionsItemSelected(final MenuItem item) {
|
||||||
final int id = item.getItemId();
|
switch (item.getItemId()) {
|
||||||
if (id == android.R.id.home) {
|
case R.id.home:
|
||||||
onBackPressed();
|
onBackPressed();
|
||||||
} else if (id == R.id.menu_item_share_error) {
|
return true;
|
||||||
ShareUtils.shareText(this, getString(R.string.error_report_title), buildJson());
|
case R.id.menu_item_share_error:
|
||||||
} else {
|
ShareUtils.shareText(this, getString(R.string.error_report_title), buildJson());
|
||||||
return false;
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void openPrivacyPolicyDialog(final Context context, final String action) {
|
private void openPrivacyPolicyDialog(final Context context, final String action) {
|
||||||
|
|
Loading…
Reference in New Issue