Commit b73ee666 by Kunj Gupta

UOFLMA-112: Fix - When we click OK on "Failed to submit form", do not exit form.

parent f288a9f7
...@@ -194,7 +194,7 @@ public class CatalogueVariableScreen extends AppCompatActivity { ...@@ -194,7 +194,7 @@ public class CatalogueVariableScreen extends AppCompatActivity {
createView(); createView();
} }
} else { } else {
showErrorDialog(R.string.failed_to_fetch_catalogue_form_string); showFetchVariableErrorDialog(R.string.failed_to_fetch_catalogue_form_string);
} }
} }
} }
...@@ -596,7 +596,7 @@ public class CatalogueVariableScreen extends AppCompatActivity { ...@@ -596,7 +596,7 @@ public class CatalogueVariableScreen extends AppCompatActivity {
if(syncStatus == SyncStatus.SUCCESS) { if(syncStatus == SyncStatus.SUCCESS) {
showSubmissionDialog(); showSubmissionDialog();
} else { } else {
showErrorDialog(R.string.failed_to_submit_form_string); showSubmitErrorDialog(R.string.failed_to_submit_form_string);
} }
} }
} }
...@@ -619,12 +619,13 @@ public class CatalogueVariableScreen extends AppCompatActivity { ...@@ -619,12 +619,13 @@ public class CatalogueVariableScreen extends AppCompatActivity {
alert.show(); alert.show();
} }
private void showErrorDialog(int message) { private void showFetchVariableErrorDialog(int message) {
AlertDialog.Builder builder = new AlertDialog.Builder(this); AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(message) builder.setMessage(message)
.setCancelable(false) .setCancelable(false)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) { public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
finish(); finish();
} }
}); });
...@@ -632,6 +633,19 @@ public class CatalogueVariableScreen extends AppCompatActivity { ...@@ -632,6 +633,19 @@ public class CatalogueVariableScreen extends AppCompatActivity {
alert.show(); alert.show();
} }
private void showSubmitErrorDialog(int message) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(message)
.setCancelable(false)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
}
});
AlertDialog alert = builder.create();
alert.show();
}
private String getMonth(int month) { private String getMonth(int month) {
return Constants.month[month]; return Constants.month[month];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment