|
@@ -59,6 +59,9 @@ public class UpdateActivity extends AppCompatActivity implements UpdateAdapter.U
|
|
|
private final static String ActionIDKey = "ActionID";
|
|
private final static String ActionIDKey = "ActionID";
|
|
|
private final static String ActionTitleKey = "ActionTitle";
|
|
private final static String ActionTitleKey = "ActionTitle";
|
|
|
private final static String SaveDataKey = "UpdateSavedJson";
|
|
private final static String SaveDataKey = "UpdateSavedJson";
|
|
|
|
|
+ private final static String SaveOrderIDKey = "UpdateSavedOrderID";
|
|
|
|
|
+ private final static String SaveActionIDKey = "UpdateSavedActionID";
|
|
|
|
|
+ private final static String SaveTitleKey = "UpdateSavedTitle";
|
|
|
|
|
|
|
|
private final static int REQUEST_SCANNER_CODE = 0;
|
|
private final static int REQUEST_SCANNER_CODE = 0;
|
|
|
private final static int REQUEST_CAMERA_CODE = 1;
|
|
private final static int REQUEST_CAMERA_CODE = 1;
|
|
@@ -80,6 +83,7 @@ public class UpdateActivity extends AppCompatActivity implements UpdateAdapter.U
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private String mOrderID;
|
|
private String mOrderID;
|
|
|
|
|
+ private String mTitle;
|
|
|
private int mActionID;
|
|
private int mActionID;
|
|
|
|
|
|
|
|
private Context mCtx = this;
|
|
private Context mCtx = this;
|
|
@@ -111,11 +115,13 @@ public class UpdateActivity extends AppCompatActivity implements UpdateAdapter.U
|
|
|
actionBar.setDisplayHomeAsUpEnabled(true);
|
|
actionBar.setDisplayHomeAsUpEnabled(true);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- String title = getIntent().getStringExtra(ActionTitleKey);
|
|
|
|
|
- setTitle(title);
|
|
|
|
|
|
|
+ if (getIntent() != null) {
|
|
|
|
|
+ mTitle = getIntent().getStringExtra(ActionTitleKey);
|
|
|
|
|
+ setTitle(mTitle);
|
|
|
|
|
|
|
|
- mOrderID = getIntent().getStringExtra(OrderIDKey);
|
|
|
|
|
- mActionID = getIntent().getIntExtra(ActionIDKey,0);
|
|
|
|
|
|
|
+ mOrderID = getIntent().getStringExtra(OrderIDKey);
|
|
|
|
|
+ mActionID = getIntent().getIntExtra(ActionIDKey,0);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
mHandler = new UpdateHandler(self);
|
|
mHandler = new UpdateHandler(self);
|
|
|
|
|
|
|
@@ -141,6 +147,12 @@ public class UpdateActivity extends AppCompatActivity implements UpdateAdapter.U
|
|
|
|
|
|
|
|
if (savedInstanceState != null) {
|
|
if (savedInstanceState != null) {
|
|
|
|
|
|
|
|
|
|
+ mTitle = savedInstanceState.getString(SaveTitleKey);
|
|
|
|
|
+ setTitle(mTitle);
|
|
|
|
|
+
|
|
|
|
|
+ mOrderID = savedInstanceState.getString(SaveOrderIDKey);
|
|
|
|
|
+ mActionID = savedInstanceState.getInt(SaveActionIDKey,0);
|
|
|
|
|
+
|
|
|
String jsonStr = savedInstanceState.getString(SaveDataKey);
|
|
String jsonStr = savedInstanceState.getString(SaveDataKey);
|
|
|
if (jsonStr != null) {
|
|
if (jsonStr != null) {
|
|
|
try {
|
|
try {
|
|
@@ -169,6 +181,13 @@ public class UpdateActivity extends AppCompatActivity implements UpdateAdapter.U
|
|
|
if (json != null) {
|
|
if (json != null) {
|
|
|
outState.putString(SaveDataKey,json.toString());
|
|
outState.putString(SaveDataKey,json.toString());
|
|
|
}
|
|
}
|
|
|
|
|
+ if (mOrderID != null) {
|
|
|
|
|
+ outState.putString(SaveOrderIDKey, mOrderID);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (mTitle != null) {
|
|
|
|
|
+ outState.putString(SaveTitleKey, mTitle);
|
|
|
|
|
+ }
|
|
|
|
|
+ outState.putInt(SaveActionIDKey, mActionID);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|