Following is the flow I have
I have an BrowserActivity which runs an angular app inside WebView.
- The BrowserActivity opens an external webpage by using js method
window.location.href = redirectUrl;, and this link is opened inside a chrome tab. I have also tried this by opening link in intent, same result. - In the chrome tab some work is done and it provides you a link to return back to the original app.
- After I press that link a new activity is launched instead of returning to old activity, meaning onNewIntent is not called.
- The weird thing if I repeat the same process in new opened activity it calls neNewIntent instead of opening new activity.
Here is my manifest code for BrowserActivity
<activity android:name=".activities.BrowserActivity" android:theme="@style/AppTheme" android:screenOrientation="fullUser" android:launchMode="singleTop">
<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:host="host.mysite.com" android:scheme="https"/>
<data android:host="host-dev.mysite.net" android:scheme="https"/>
<data android:scheme="mysite-host"/>
<data android:scheme="mysite-callback"/>
</intent-filter>
</activity>
First time BrowserActivity is launched with following intent.
Note: I logged the scheme here. The scheme is null.
Intent intent = new Intent(context, BrowserActivity.class);
intent.putExtra(URL, url);
intent.putExtra(TITLE, title);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
First time the BrowserActivity loads 'mysite-host://host-dev.mysite.net/link1' and for returning from browser following link is provided 'mysite-callback://host-dev.mysite.net/link1/login/done'.
My question is why is onNewIntent is not fired the first time returning from browser.