Is there any function at manifest or somewhere when I install my app, the app it will appeare at device like browser app?

爷,独闯天下 提交于 2019-12-25 00:10:15

问题


I am making my apk like browser but the problem it is when I install at emulator or at device the app it is not at the DefaultApps -> BrowserApp it is only at the apps. Or if anyone has an idea how to do that please let me know.

I want it to show at the BrowserApps.

This is my manifest.xml

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="searchwith.smartbrowser">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.SET_WALLPAPER"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.SET_ALARM" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:usesCleartextTraffic="true"
    android:theme="@style/AppTheme"
    tools:ignore="GoogleAppIndexingWarning">
    <activity android:alwaysRetainTaskState="true"
        android:configChanges="orientation|screenSize"
        android:name=".MainActivity"
        android:launchMode="singleTop"
        android:theme="@style/AnimationActivityUpDown">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
            <category android:name="android.intent.category.BROWSABLE"/>
            <category android:name="android.intent.category.APP_BROWSER" />
            <data android:scheme="http" android:host="market.android.com"
                android:path="/search" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.ASSIST"/>
            <category android:name="android.intent.category.DEFAULT"/>
        </intent-filter>
    </activity>
    <activity android:name=".Activity.SettingsActivity"
        android:parentActivityName=".MainActivity" >
        <meta-data android:name="android.support.PARENT_ACTIVITY"
            android:value=".MainActivity" />
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
            <category android:name="android.intent.category.BROWSABLE"/>
            <category android:name="android.intent.category.APP_BROWSER" />
        </intent-filter>
    </activity>
    <activity android:name=".Activity.BookmarkActivity"
        android:configChanges="orientation|screenSize|keyboardHidden|keyboard">
        <intent-filter>
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:mimeType="application/browser" />
            <data android:scheme="file"/>
        </intent-filter>
    </activity>

    <activity android:name=".Activity.ActivityBookmarksFavorites" />
    <activity android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
        android:label="@string/Search" android:name=".Activity.ActivitySearchEngine"
        android:parentActivityName=".MainActivity"
        android:windowSoftInputMode="stateAlwaysHidden|adjustResize">
        <meta-data android:name="android.support.PARENT_ACTIVITY" android:value=".MainActivity" />
        <intent-filter>

            <action android:name="android.intent.action.WEB_SEARCH"/>

            <category android:name="android.intent.category.DEFAULT"/>

        </intent-filter>
    </activity>
    <activity android:name=".Activity.ActivityChangeBookmark" />
    <meta-data
        android:name="io.fabric.ApiKey"
        android:value="f377a69c30ecd2751f1b7f58c7929116dac16bd0" />
    <receiver android:name=".interfaces.NotificationReceiver" />
</application>


</manifest>

回答1:


use this code in manifest

<intent-filter>
    <data android:scheme="anton" />
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" /> <--Not positive if this one is needed
    ...
</intent-filter>

for more reference:- Make a link in the Android browser start up my app?



来源:https://stackoverflow.com/questions/54748213/is-there-any-function-at-manifest-or-somewhere-when-i-install-my-app-the-app-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!