Launching an Android Application from the Browser

前端 未结 2 641
抹茶落季
抹茶落季 2020-11-30 06:36

I have looked at several Stack Overflow questions with similar titles to mine. Each is answered, and the original author seems satisfied, but when I try to replicate their r

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-30 06:47

    You cannot use MAIN -- URLs in Android are only VIEWed from the browser or WebView.

    Also, none of your Intent filters include the BROWSABLE category, so they will never work with the browser.

    It is not recommended to invent your own schemes. You can use a regular HTTP scheme, for some domain that you control. This sample project demonstrates this. In particular, you can follow the pattern shown by this filter:

    
        
        
        
        
    
    

    replacing www.this-so-does-not-exist.com with something you own, and perhaps adding in a path to narrow the filter's scope. You can also see this technique used by the Barcode Scanner app from ZXing.

提交回复
热议问题