How to add my browser in the default browser selection list in android?

前端 未结 1 1122
花落未央
花落未央 2020-12-22 03:28

I have a app called \"TextOnly\" ..How to add in the list to select default browser?

相关标签:
1条回答
  • 2020-12-22 04:06

    Specify your intent in the android manifest file such as:

    <intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:scheme="http"/> 
    </intent-filter>
    

    make sure:

    <uses-permission android:name="android.permission.INTERNET"></uses-permission>
    

    is in there too.

    reference:

    Similarly, if the action is ACTION_VIEW and the data field is an http: URI, the receiving activity would be called upon to download and display whatever data the URI refers to.

    0 讨论(0)
提交回复
热议问题