I’m new at Android Development, so I’ve now a question about the Back Stack.
I’ve an Application where I’ve defined an Intent which starts the App with a Custom URL Scheme.
When Starting the App by this way, the App Starts with the Activity.
When Pressing the Back Button, the App will be closed and I see the Internet Application with the Link where I opened the App.
What I want to do is to show the last View opened in the App or the Home Screen of the App when pressing the back Button, not to close it.
Strange is that when Opening the App from URL on the Back Stack is only one View, the View what the Intent Filter, then I close the App (Pressing Back) and if I open then the App on the Home Screen I see the Back Stack the last time I opened the App (not from the URL Scheme).
What I did wrong?
PS: I tested it on a Samsung Galaxy Ace, Gingerbread
<activity android:name="com.myapp.engine.URLActivity"
android:label="@string/app_name" >
<intent-filter>
<data android:scheme="myapp" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
Android works in that way. You are calling an external app’s activity from your application. Try to set task affinity in manifest file. I am not sure that will work.