Startactivityforresult from Activitygroup

startActivityForResult from ActivityGroup

Converting comments as answer,
Try using onResume() to update UI of SummerCostScreen

how to call startactivityforresult from one activity to another within a activity group inside a tabwidget

Change startActivity to:

.startActivityForResult(i, .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP));

then add this method to ActivityA:

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// See which child activity is calling us back.
switch (resultCode) {
case RESULT_OK:
{
//processing code goes here
}
default:
break;
}
}

and then when finish() is called on Activity B you should hit the 'OnActivityResult' method. You can also send an intent back to main activity by calling:

setResult(Activity.Result_OK, intent);

on Activity B.

Android - startActivityForResult immediately triggering onActivityResult

You can't use startActivityForResult() if your activity is being launched as a singleInstance or singleTask. standard or singleTop launch mode will fix the problem.

android: Activity.startActivityForResult() or ActivityGroup?

IMHO, none of the above.

Popping out of one activity into another briefly via startActivityForResult() is fine...once. It gets cumbersome for users and developers alike when there are several.

Consider recasting your UI as a wizard, perhaps driven by a ViewFlipper, so you can keep all of this in a single activity. It also provides the user with a recognized pattern for going back and forth within the chain of steps leading to them providing all of the information you need.

startActivityForResult not working TabGroupActivity in android

Your onActivityResult is called on the ActivityGroup and not on the subActivity of your tabgroupActivity.

So override the method onActivityResult , and then create an abstract method on the mother class of your SubActivities ( on the TabActivityGroup i think ), and override it on each subActivity .

Android Use startActivityForResult from a nested activity in a tab.

Alright, I was able to find a solution to this problem.

First, I created another activity that I started using the basic startActivity() call I called a Result Controller. This does not pass any data back to the tabbed activity which means you don't have to worry about where it's going.

Second, I created a simple static data class which I called DataConnector. The ResultController would get the instance of the DataConnector and insert the Data there

Then, in the original activity(in the tabs) I implemented the onWindowFocusChanged method to determine when the user is back to it. I got the instance of DataConnector and was able to pull the data I needed out of there.



Related Topics



Leave a reply



Submit