I want to click on a URL I received in my email (ex. https://example.com) and have that open my app, then launch that URL in a browser within my app. (ChromeCustomTabs
would have been nice, but it launches my app in an endless loop, due to SplashActivity's intent.action.VIEW
filter on that URL)
- The URL will be something like https://example.com/somePath?query=example...
- I do NOT have the ability to customize the URL sent out via email.
- I want to open the same URL that opens the app in the browser.
- I want to open the browser within my app.
- Additional Info : The actual URL has additional path and query parameters, which are parsed out and handled within my
SplashActivity
to redirect to the correct screens with the necessary data. In some cases, the URL will not be opened in the app's native browser, but the user will be directed to another screen.
<activity
android:name="com.mypackage.myapp.splash.SplashActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<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="example.com"
android:scheme="https" />
</intent-filter>
</activity>
I have accomplished this with WebView
but given some of WebView
's limitations and security issues I'd like to do this without using WebView.