我在活动组联系人列表中打开联系人列表是在选择联系人后打开onActivityResult不工作。如果有任何想法请提前帮助我。
Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
getParent().startActivityForResult(intent, PICK_CONTACT_REQUEST);
protected void onActivityResult(int requestCode, int resultCode, Intent intent){
super.onActivityResult(reqCode, resultCode, data);
if (requestCode == PICK_CONTACT_REQUEST) {
}
}
答案 0 :(得分:2)
最后,我通过在ParentActivity中覆盖onActivityResult获得了我的答案
protected void onActivityResult(int requestCode, int resultCode,
Intent intent) {
if (requestCode == YOUR_REQUEST_CODE) {
ChildActivityName activity = (ChildActivityName)getLocalActivityManager().getCurrentActivity();
System.out.println("onActivity..");
activity.onActivityResult(requestCode, resultCode, intent);
}
}
在儿童活动中
public void onActivityResult(int reqCode, int resultCode, Intent data) {
super.onActivityResult(reqCode, resultCode, data);
}