Hello, I'm working on launching my app from a URL....
# android
Hello, I'm working on launching my app from a URL. I have the intent-filter set up in my manifest:
Copy code

			<intent-filter android:autoVerify="true">
				<action android:name="android.intent.action.VIEW" />

				<category android:name="android.intent.category.DEFAULT" />
				<category android:name="android.intent.category.BROWSABLE" />

					android:scheme="https" />
					android:scheme="http" />
I've created the intent from the URL:
Copy code
val url: HttpUrl = HttpUrl.Builder()
			.addQueryParameter("voucher", voucherContents)
		val sendIntent: Intent = Intent().apply {
			action = Intent.ACTION_SEND
			putExtra(Intent.EXTRA_TEXT, url.toString())
			type = "text/plain"
		val shareIntent = Intent.createChooser(sendIntent, url.host)
		startActivity(context, shareIntent, null)
This pops up a chooser window where I can select an app or copy to clipboard. I choose the latter and then open up an app such as Slack or Sheets or something and paste it in. When I click the URL link I just pasted, it opens MyTargetActivity successfully, but it's in the app that opened it rather than a new application. How do I get it to launch as a standalone application? (I've also written the server part and gotten that working. I can rummage that up if needed.)
ūüė∂ 4
You may try firebase dynamic link
I'll look into them. Is there no way to do it with the applink though? I feel like I'm mostly there. Am I missing a url flag perhaps or an intent-filter category?
Maybe you can set activity launchMode = ‚ÄúSingleTask‚ÄĚ
Thanks. I tried out SingleTask. In the case where my app isn't running, it successfully fires it up as a standalone task. For the case where my app is already running, it just brings my app to the forefront. This is an issue because it ignores the data of the intent, which I need. Any way to get the standalone, but still act on the data in the intent?
Have you tried to override onNewIntent method
I have. I'm still trying to figure out what triggers a call to it.
Thanks guys. I have a working solution now using SingleTask as well as onNewIntent.