I have two activities. One activity has the main game and the other activity has the game over screen which is truly just a custom alert dialog. In the game over screen there is a button that when clicked launches a new Activity.
String authUrl = httpOauthprovider.retrieveRequestToken(httpOauthConsumer, OAUTH_CALLBACK_URL);
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl));
intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY );
startActivity(intent);
The page is a twitter authorization page but the problem I am having is that when I click the Authorize App button the activity with the alert dialog launches again (Calling create instead of onNewIntent).
I have tried different launch modes (singleInstance,singleTask and singleTop).
Each of them have their problems. singleInstance and singleTask will clear the original calling activity so when the AlertDialog slides in the original activity is changed to the menu page. singleTop always calls create again first (eventhough it doesn’t call onDestroy)
Does anyone have any recommendations or examples on how I can get this done?
Incidentally, the activity that calls the game activity is a standard launchmode
Thanks in Advance
What I ended up doing was make the call to the the new activity from the original caller. So when I choose to to tweet the message from the custom alert dialog I close the alert dialog activity with the result requesting a tweet and from the original activity I make the call to the third activity (twitter authorization). It’s not the answer I was looking for but this is how I solved the problem. If anyone knows a better more eloquent solution I’d love to know it.
SO The flow now goes A->B->A->C->A->B instead of A->B->C->B