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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -44,4 +44,11 @@
|
||||
app:showAsAction="never|withText"
|
||||
android:title="@string/export_data_menuItem" />
|
||||
</group>
|
||||
<item
|
||||
android:id="@+id/action_about_datasharing"
|
||||
android:enabled="true"
|
||||
android:icon="@drawable/ic_action_settings"
|
||||
app:showAsAction="never|withText"
|
||||
android:title="@string/about_data_sharing" />
|
||||
|
||||
</menu>
|
||||
|
||||
@@ -35,14 +35,14 @@
|
||||
android:icon="@drawable/ic_action_settings"
|
||||
app:showAsAction="never|withText"
|
||||
android:title="@string/data_sharing_log_in" />
|
||||
-->
|
||||
|
||||
<item
|
||||
android:id="@+id/action_about_datasharing"
|
||||
android:enabled="true"
|
||||
android:icon="@drawable/ic_action_settings"
|
||||
app:showAsAction="never|withText"
|
||||
android:title="@string/about_data_sharing" />
|
||||
|
||||
-->
|
||||
</group>
|
||||
<group android:id="@+id/grp4">
|
||||
<item
|
||||
|
||||
@@ -377,9 +377,6 @@
|
||||
<string name="datasharing_notification_title">OpenSeizureDetector Data Sharing Problem</string>
|
||||
<string name="datasharing_about_title">OpenSeizureDetector Data Sharing</string>
|
||||
<string name="datasharing_about_text">
|
||||
Data Sharing is not working correctly. \n
|
||||
This might be because you have not registered an account and logged in to the data sharing system,\n
|
||||
or it may be a networking problem. \n\n
|
||||
<b>Please register for Data Sharing and Log in using the App menu or button below</b>\n\n
|
||||
This will help with developing OpenSeizureDetector to increase the
|
||||
detection reliability and reduce the false alarm rate\n\n
|
||||
|
||||
Reference in New Issue
Block a user