在ActivityGroup onActivityResult不工作



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

最后我得到了我的答案onActivityResult在ParentActivity

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);
        }
    }

child Activity

public void onActivityResult(int reqCode, int resultCode, Intent data) {
        super.onActivityResult(reqCode, resultCode, data);
    }

相关内容

  • 没有找到相关文章

最新更新