|
@@ -26,20 +26,27 @@ public class CallActivity extends BaseActionActivity {
|
|
|
super.onCreate(savedInstanceState);
|
|
|
setContentView(R.layout.activity_call);
|
|
|
changeStatusBar(false);
|
|
|
- initData();
|
|
|
- initView();
|
|
|
+ boolean isOK = initData();
|
|
|
+ if (isOK) {
|
|
|
+ initView();
|
|
|
+ } else {
|
|
|
+ toast(getString(R.string.data_error));
|
|
|
+ finish();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- private void initData() {
|
|
|
+ private boolean initData() {
|
|
|
Gson gson = new Gson();
|
|
|
mType = getIntent().getIntExtra(Constant.INTENT_VIEW_TYPE, 0);
|
|
|
String value = getIntent().getStringExtra(Constant.INTENT_VIEW_VALUE);
|
|
|
Log.d(TAG, "initData: " + mType + " value:" + value);
|
|
|
if (mType == 0) {
|
|
|
mContactModel = gson.fromJson(value, ContactBean.class);
|
|
|
+ return mContactModel != null;
|
|
|
} else {
|
|
|
mRecentModel = gson.fromJson(value, RecentBean.class);
|
|
|
mContactModel = mRecentModel.contactBean;
|
|
|
+ return mRecentModel != null;
|
|
|
}
|
|
|
}
|
|
|
|