David Alford
08/31/2021, 4:42 PM<activity
android:name=".MyTargetActivity"
android:screenOrientation="portrait">
<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" />
<data
android:host="my.host.com"
android:scheme="https" />
<data
android:host="my.host.com"
android:scheme="http" />
</intent-filter>
</activity>
I've created the intent from the URL:
val url: HttpUrl = HttpUrl.Builder()
.scheme("https")
.host("<http://my.host.com|my.host.com>")
.addPathSegment("invite")
.addQueryParameter("voucher", voucherContents)
.build()
val sendIntent: Intent = Intent().apply {
action = Intent.ACTION_SEND
putExtra(Intent.EXTRA_TEXT, url.toString())
type = "text/plain"
toUri(0)
}
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.)Umar Ata
08/31/2021, 5:08 PMDavid Alford
08/31/2021, 5:12 PMDecor
09/01/2021, 3:35 AMDavid Alford
09/01/2021, 5:16 PMUmar Ata
09/01/2021, 7:34 PMDavid Alford
09/01/2021, 9:48 PMDavid Alford
09/02/2021, 4:17 PM