Here is my scenario:
- The user opens the app and uses it => the app is in one of its screens
- The user moves the app in the background by using the Home key
- The user starts the browsing and browses on my site. Withing the website, certain links open the app
- The user clicks on a link in the browser and the app is started, since it is singleInstance
onNewIntentfires and I handle the intent fine
The app has a SplashActivity as the default launching activity which does a small web call while showing an loading image and then starts the HomeActivity
<activity
android:name="SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
I simply start the HomeActivity by calling:
startActivity(new Intent(context, HomeActivity.class));
My main activity is using intent filter data so I've added:
<activity android:name=".HomeActivity"
<intent-filter>
<data android:scheme="myprop" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
Here is what happens:
- if the app is started for the first time, SplashScreen loads fine and starts HomeActivity. If the user is in the browser and clicks on a specific link, the activity is woken up and processes the intent.
- The problem is, while the app is in background
onPauseif I press the app's icon from the launcher, SplashActivity starts and when it is supposed to open HomeActivity it does not do it, the app simply stops. This behavior has started when I used singeInstance. The norma behavior here would be to resume the activity... Any ideas ?
0 comments:
Post a Comment