Fixed issue with export data screen showing when selecting other menu items. Fixes #93
This commit is contained in:
@@ -512,6 +512,7 @@ public class LogManagerControlActivity extends AppCompatActivity {
|
||||
})
|
||||
.setNegativeButton(android.R.string.no, null)
|
||||
.show();
|
||||
return true;
|
||||
case R.id.action_mark_false_alarm:
|
||||
Log.i(TAG, "action_mark_false_alarm");
|
||||
new AlertDialog.Builder(this)
|
||||
@@ -525,6 +526,7 @@ public class LogManagerControlActivity extends AppCompatActivity {
|
||||
})
|
||||
.setNegativeButton(android.R.string.no, null)
|
||||
.show();
|
||||
return true;
|
||||
case R.id.export_data_menuitem:
|
||||
Log.i(TAG, "export data menu item");
|
||||
try {
|
||||
@@ -536,6 +538,10 @@ public class LogManagerControlActivity extends AppCompatActivity {
|
||||
Log.i(TAG, "exception starting export data activity " + ex.toString());
|
||||
}
|
||||
return true;
|
||||
case R.id.action_about_datasharing:
|
||||
Log.i(TAG, "action_about_datasharing");
|
||||
showDataSharingDialog();
|
||||
return true;
|
||||
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
@@ -765,4 +771,32 @@ public class LogManagerControlActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
private void showDataSharingDialog() {
|
||||
mUtil.writeToSysLogFile("MainActivity.showDataSharingDialog()");
|
||||
View aboutView = getLayoutInflater().inflate(R.layout.data_sharing_dialog_layout, null, false);
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setIcon(R.drawable.datasharing_fault_24x24);
|
||||
builder.setTitle(R.string.data_sharing_dialog_title);
|
||||
builder.setNegativeButton(getString(R.string.cancel), null);
|
||||
builder.setPositiveButton(getString(R.string.login), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
Log.i(TAG, "dataSharingDialog.positiveButton.onClick()");
|
||||
try {
|
||||
Intent i = new Intent(
|
||||
LogManagerControlActivity.this,
|
||||
AuthenticateActivity.class);
|
||||
mContext.startActivity(i);
|
||||
} catch (Exception ex) {
|
||||
Log.i(TAG, "exception starting activity " + ex.toString());
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
builder.setView(aboutView);
|
||||
builder.create();
|
||||
builder.show();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user