androidandroid-contactsactivitygroup

In ActivityGroup onActivityResult is not working?


I am opening contact list in activity group contact list is opening after selecting contact onActivityResult is not working.if any one have idea please help me thanks in advance.

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)   {

}
}

Solution

  • finally i got my answer by overing onActivityResult in 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);
            }
        }
    

    in child Activity

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