stuck with getting camera pic when using the tab Activity

As for I understand from your Question is,
This happen while using ActivityGroup. Since you are starting Activity for result inside a child Activity (i.e TakePicture.class), and Android will only allow single nested layer of child Activity(ies) (means child Activity cannot nest another child Activity).
And you are probably handling the result in your child Activity(i.e TakePicture.class).

So the solution to your problem is to handle that result inside your parent Activity (OpenBeeActivityGroup)’s onActivityResult() and then send your result to the active Activity.
you will use something like this.
inside your child Activity start your startActivityForResult() from parent Activity like.

getParent().startActivityForResult(cameraIntent,Global.CAMERA_PIC_REQUEST);

and inside your onActivityResult() of ActivityGroup (OpenBeeActivityGroup):

protected void onActivityResult(int requestCode, int resultCode, Intent data) 
{
    if (resultCode == Activity.RESULT_OK) 
    {
        switch(requestCode)
        {
        case Global.CAMERA_PIC_REQUEST: // global variable to indicate camera result
        Activity activity = getLocalActivityManager().getCurrentActivity();
        activity.onActivityResult(requestCode, resultCode, data);
        break;
        }

    }
}

Leave a Comment