How to open android application when an URL is clicked in the browser

后端 未结 2 1650
清酒与你
清酒与你 2021-01-06 08:48

I have to open my android application, when user clicks on a link that has my domain name. For example, lets say my domain is abc.com and i have posted this link on my Faceb

2条回答
  •  猫巷女王i
    2021-01-06 09:31

    You have to define a custom Intent Filter in the activity that should be launched when the url is clicked.

    Let say that you want to launch the FirstActivity when a user click a http://www.example.com/ link on a web page.

    Add this to your activity in the Manifest :

    
      
        
        
        
        
      
    
    

    When the user will click a HTML link to http://www.example.com/, the system will prompt either to use the browser or your app.

提交回复
热议问题