|
@@ -43,23 +43,38 @@ public class ContactsActivity extends BaseActivity {
|
|
setContentView(R.layout.activity_itemlist);
|
|
setContentView(R.layout.activity_itemlist);
|
|
Log.d(TAG, "onCreateBase");
|
|
Log.d(TAG, "onCreateBase");
|
|
|
|
|
|
|
|
+ refreshData(getIntent());
|
|
|
|
+
|
|
//去掉launcher中的new message
|
|
//去掉launcher中的new message
|
|
DataManager.setNewMessageStatus();
|
|
DataManager.setNewMessageStatus();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @SuppressLint("NotifyDataSetChanged")
|
|
@Override
|
|
@Override
|
|
- protected void initData() {
|
|
|
|
- super.initData();
|
|
|
|
|
|
+ protected void onNewIntent(Intent intent) {
|
|
|
|
+ Log.d(TAG, "onNewIntent: ");
|
|
|
|
+ super.onNewIntent(intent);
|
|
|
|
+ refreshData(intent);
|
|
|
|
+
|
|
|
|
+ //刷新
|
|
|
|
+ if (mRecyclerAdapter != null) {
|
|
|
|
+ ContactsActivity.this.runOnUiThread(()-> {
|
|
|
|
+ mRecyclerAdapter.setDataList(mDataList);
|
|
|
|
+ mRecyclerAdapter.notifyDataSetChanged();
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ private void refreshData(Intent intent) {
|
|
//判断是否从其他apk分享
|
|
//判断是否从其他apk分享
|
|
- Intent intent = getIntent();
|
|
|
|
Bundle bundle = intent.getExtras();
|
|
Bundle bundle = intent.getExtras();
|
|
if (bundle != null) {
|
|
if (bundle != null) {
|
|
mShareType = bundle.getInt("type");
|
|
mShareType = bundle.getInt("type");
|
|
mShareFilePath = bundle.getString("data");
|
|
mShareFilePath = bundle.getString("data");
|
|
- Log.d(TAG, "initData: mShareType:" + mShareType);
|
|
|
|
|
|
+ Log.d(TAG, "refreshData: mShareType:" + mShareType + " mShareFilePath:" + mShareFilePath);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ mDataList.clear();
|
|
List<ContactBean> contactList = new DatabaseUtils().loadContacts();
|
|
List<ContactBean> contactList = new DatabaseUtils().loadContacts();
|
|
mDataList = DataManager.getContactList(contactList, mShareType > 0);
|
|
mDataList = DataManager.getContactList(contactList, mShareType > 0);
|
|
}
|
|
}
|