Commit b12e1a8c by Kunj Gupta

UOFLMA-105: Fix - Not showing success message after submitting order service.

parent 852aaf66
......@@ -33,7 +33,6 @@ import android.text.method.LinkMovementMethod;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.webkit.MimeTypeMap;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.DatePicker;
......@@ -587,14 +586,6 @@ public class CatalogueVariableScreen extends AppCompatActivity {
});
}
public String getMimeType(Uri uri) {
ContentResolver cR = getContentResolver();
MimeTypeMap mime = MimeTypeMap.getSingleton();
String type = mime.getExtensionFromMimeType(cR.getType(uri));
return cR.getType(uri);
}
@Override
protected void onPostExecute(SyncStatus syncStatus) {
super.onPostExecute(syncStatus);
......@@ -602,13 +593,31 @@ public class CatalogueVariableScreen extends AppCompatActivity {
progressDialog.dismiss();
}
if(syncStatus == SyncStatus.SUCCESS) {
finish();
showSubmissionDialog();
} else {
showErrorDialog(R.string.failed_to_submit_form_string);
}
}
}
public String getMimeType(Uri uri) {
ContentResolver cR = getContentResolver();
return cR.getType(uri);
}
private void showSubmissionDialog() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(R.string.variable_form_order_successful_submission_string)
.setCancelable(false)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
finish();
}
});
AlertDialog alert = builder.create();
alert.show();
}
private void showErrorDialog(int message) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(message)
......
......@@ -57,6 +57,7 @@
<string name="variable_form_ui_page_no_selected_attachment_string">Not Selected</string>
<string name="custom_setting_storage_permission_dialog_msg_string">To use this feature, please go to Settings -> Apps -> %s -> Permissions and enable \'Storage\' permission</string>
<string name="variable_form_back_navigation_string">Are you sure you want to navigate away?</string>
<string name="variable_form_order_successful_submission_string">Your Order has been submitted successfully</string>
<string name="Variable_form_short_description_anchor_line_break_css"><![CDATA[
<style>
a {
......
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