Android App link - Open a url from app in browser without triggering App Link

后端 未结 4 498
名媛妹妹
名媛妹妹 2021-01-12 05:46

I have enabled App linking in my application. It works fine. But in my application there are some scenarios where i cannot handle the incoming url. In those cases i want to

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-12 06:27

    In Kotlin, try using makeMainSelectorActivity :

    val defaultBrowser = Intent.makeMainSelectorActivity(Intent.ACTION_MAIN, Intent.CATEGORY_APP_BROWSER)
    defaultBrowser.data = Uri.parse("https://yoururl.com/")
    startActivity(defaultBrowser)
    

提交回复
热议问题