1

我正在打开活动组联系人列表中的联系人列表在选择联系人 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)   {

}
}
4

1 回答 1

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);
    }
于 2013-06-05T10:38:52.820 回答