Reputation: 7928
In MainActivity.java, I extends TabActivity to use Tabhost.
public class MainActivity extends TabActivity
In each Tab, I use ActivityGroup to manage some child activity
public class MerchandiserTabGroupActivity extends ActivityGroup
In a child activity A, I want to start another child activity B.
Intent intCreateClaim = new Intent(mContext, MultiPhotoSelectActivity.class);
startActivityForResult(intCreateClaim, Parameter.ACTIVITY_SELECT_IMAGE);
After I call setResult(RESULT_OK)
and finish()
in Activity B, onActivityResult()
in Activity A isn't called.
Can anyone helps me? Thanks in advance.
Upvotes: 0
Views: 245
Reputation: 438
This happens because after B activity finishes, Android returns to your TabActivity, not your A activity.
Use fragments. This way you will not have to deal with multiple activities. You will have only one parent activity with fragments inside. To make your life easier and to add support for pre-ICS Android devices, try GrilledUI library.
Upvotes: 1
Reputation: 9808
I know this isn't really the answer you're looking for, but you're using deprecated API. You should try a refactor and use the new Fragment API and the v4 support library if you need to support older versions of Android too. Using fragments you won't need to rely on setResult and onActivityResult.
Upvotes: 2