简体   繁体   English

如何在Android上的“打开方式”列表中显示我的应用程序

[英]How to show my app in “Open with” list on android

I create a simple app with webview that can handle/open any URL. 我用webview创建了一个简单的应用程序,可以处理/打开任何URL。 But the problem is that my app will not be shown in open with list when I click on any hyperlinks. 但问题是,当我点击任何超链接时,我的应用程序将不会列表显示。

图像打开列表

As shown in above image I click on a hyperlink and it popup an open with list but my app is not shown here. 如上图所示,我单击一个超链接,它弹出一个打开的列表,但我的应用程序没有显示在这里。 So, I want to show my app also shown in this open with list. 所以,我想显示我的应用程序也显示在此打开列表中。

Manifest code: 清单代码:

<application
    android:allowBackup="false"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

    <activity
        android:name="biz.coolpage.aashish.app.MainActivity"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:label="@string/app_name"
        android:theme="@style/AppTheme.Translucent.Light"
        android:hardwareAccelerated="true"
        android:launchMode="singleInstance"
        android:alwaysRetainTaskState="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:mimeType="text/link"
                android:scheme="http" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.SEND" />
            <data android:mimeType="text/plain"/>
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

Add another activity with this intent filter 使用此intent过滤器添加另一个活动

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM