0

My activity definition looks like this:

 <activity
        android:name="com.broadvision.myvv.MyVV_Splash"
        android:screenOrientation="portrait">

        <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="vmoso" /> 
            <data 
                android:host="www.vmoso.com"
                android:scheme="http" />
            </data>
        </intent-filter>
    </activity>

This activity is root activity in my app, it can be started from browser app, after this, if I hit browser icon, what I want to see is the browser UI, but in fact, I still see my own app, which is incorrect.
I've tried to add android:launchMode="singleInstance" and android:launchMode="singleTask", it works for this case, i.e.: my app activity starts as a new task, and I can switch back to browser, but when I hit my app icon from home screen, it always starts as a new task, which is not what I want to see, I want to see the last Activity when I leave.
Also tried android:allowTaskReparenting="true", but doesn't work, I believe the point is on launchMode, but after tried all 4 modes, still cannot figure it out.

LiuWenbin_NO.
  • 1,216
  • 1
  • 16
  • 25
  • 1
    you define the scheme twice, you just need it inside the second . Did you try by using your own scheme? – Jibbo Jul 16 '15 at 08:18
  • I try from browser by using the second , i.e.: the http scheme. I'll move the 1st scheme into the 2nd . – LiuWenbin_NO. Jul 16 '15 at 08:21
  • Sorry, I didn't get the question earlier. I think you just need to put android:clearTaskOnLaunch="true" as an attribute of – Jibbo Jul 16 '15 at 08:32
  • @Jibbo I tried to add `android:clearTaskOnLaunch=true`, but get the same result, my app still stays in the task of browser app. – LiuWenbin_NO. Jul 16 '15 at 08:48
  • try defining a different process in if it still doesn't work than all I have is an hacky way :S – Jibbo Jul 16 '15 at 09:04
  • Sorry, here's the link on how to do it: http://developer.android.com/guide/topics/manifest/activity-element.html#proc – Jibbo Jul 16 '15 at 09:04
  • Added `android:process="@string/app_name"`, sorry it doesn't work. BTW, when I did my testings, I have no `launchMode` attribute set, and I think I need it. But if I add it, I will run into another issue as I descriped. – LiuWenbin_NO. Jul 16 '15 at 09:16
  • The only launchmode that i can think of in this segment is "singleTop".. but if you still have that issue there's only the way of an activity that just launch your other activity with the CLEAR_TOP and NEW_TASK flags but it's hacky.... – Jibbo Jul 16 '15 at 09:36
  • `NEW_TASK` should be the same as `singleTask` defined in manifest. And I am starting my app from Android built-in browser app (and it is also possible from other apps), I cannot modifed their code to add any flag to intent when starting my activity. – LiuWenbin_NO. Jul 16 '15 at 09:47
  • I didin't express myself well, what I meant was something like this: browser->click->open an "invisible" activity which calls your other activity with the above mentioned parameters->your app will start in a different session than the browser's and it will recover from when you left if you close it. – Jibbo Jul 16 '15 at 10:12

0 Answers0