First time posting a question and I apologize, there are a ton of questions on this issue but after trying many different options I can't seem to get this to work.
I have a twitter application that the main screen has a button that requests oauth twitter access through the standard browser app, and then returns to the main screen. If I hit the back button, the browser app opens with the twitter website. I've tried noHistory in the manifest file, and when starting the intent FLAG_ACTIVITY_NO_HISTORY as well as FLAG_ACTIVITY_CLEAR_TOP and Intent.FLAG_ACTIVITY_SINGLE_TOP in many scenarios with no luck.
Here is my latest code:
Manifest file
<activity android:name=".oauth"
android:label="@string/oauth_name"
android:noHistory="true"
>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="tm" android:host="twitt" />
</intent-filter>
</activity>
<activity android:name="com.tweetymanagerpro.Home"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar"
android:windowSoftInputMode="stateHidden|adjustPan">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>
In the Home activity, I call the oauth as follows
Intent settingsActivity = new Intent(getBaseContext(), oauth.class);
settingsActivity.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
startActivity(settingsActivity);
Next, in oauth.onCreate() I call for the twitter url
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl));
intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
this.startActivity(intent);
Next, in oauth.onResume() I handle the tokens etc and then start Home again
Intent i = new Intent(this, Home.class);
i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(i);
The connection to twitter works great, it's just now at Home if I hit the back button it takes me back to the browser where it is authenticating with twitter.