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

后端 未结 2 1651
清酒与你
清酒与你 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条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-06 09:40

    You can achieve this by using URI schemes (link e.g. myscheme://open/chat), add into your manifest this filter into e.g. main activity section (set your scheme name):

    
          
          
          
          
    
    

    In your activity where you've set filter, you can get URI by calling this (in onCreate):

    Uri intentUri = getIntent().getData();
    

提交回复
热议问题