Android应用程序创建两个启动器图标

Android应用程序创建两个启动器图标

本文介绍了Android应用程序创建两个启动器图标,而不是一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的问题,在安装应用程序时,我看到两个图标,一个会启动该应用程序,另一个在单击时会显示未安装应用程序".

I have a weird problem, where when installing the application I see two icons, one launches the application and the other says "App is not installed" when I click it.

我确定我只有一个包含

<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />

我什至在intermediaries文件夹中检查了合并的最终AndroidManifest.xml,但仍然看不到另一个android.intent.category.LAUNCHER.

I even checked the merged final AndroidManifest.xml in the intermediaries folder, and I still don't see another android.intent.category.LAUNCHER.

这是我的主要AndroidManifest.xml

Here is my main AndroidManifest.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="com.example.package">

<uses-permission
    android:name="android.permission.GET_ACCOUNTS"
    tools:remove="android:maxSdkVersion" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.READ_SYNC_STATS" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />

<application
    android:name=".App"
    android:allowBackup="false"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme"
    tools:replace="android:allowBackup">

    <activity
        android:name=".activity.LauncherActivity"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.NoDisplay">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity
        android:name=".activity.VerificationActivity"
        android:label="@string/app_name"
        android:theme="@style/AppTheme.Verification" />

    <activity
        android:name=".activity.HomeActivity"
        android:label="@string/app_name"/>

    <activity
        android:name="com.facebook.FacebookActivity"
        android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Translucent.NoTitleBar" />

    <activity
        android:name=".activity.MallActivity"
        android:parentActivityName=".activity.HomeActivity" />

    <activity android:name=".activity.StoreActivity" />

    <activity
        android:name=".activity.EnclosedFragmentActivity"
        android:theme="@style/AppTheme"
        android:windowSoftInputMode="adjustPan" />

    <provider
        android:name=".provider.MallBuddyProvider"
        android:authorities="com.example.package"
        android:exported="false"
        android:syncable="true" />

    <activity
        android:name=".activity.SearchActivity"
        android:launchMode="singleTop"
        android:theme="@style/AppTheme">
        <intent-filter>
            <action android:name="android.intent.action.SEARCH" />
        </intent-filter>
        <meta-data
            android:name="android.app.searchable"
            android:resource="@xml/searchable" />
    </activity>

    <service android:name=".sync.AuthenticatorService"
        android:exported="false">
        <intent-filter>
            <action android:name="android.accounts.AccountAuthenticator" />
        </intent-filter>
        <meta-data
            android:name="android.accounts.AccountAuthenticator"
            android:resource="@xml/authenticator" />
    </service>

    <service
        android:name=".sync.SyncService"
        android:exported="true"
        android:process=":sync">
        <intent-filter>
            <action android:name="android.content.SyncAdapter" />
        </intent-filter>
        <meta-data
            android:name="android.content.SyncAdapter"
            android:resource="@xml/syncadapter" />
    </service>

    <meta-data
        android:name="com.facebook.sdk.ApplicationId"
        android:value="@string/facebook_app_id" />
</application>

推荐答案

有时我会在测试设备上的应用程序时遇到这种情况,重新启动设备会删除损坏的设备,从而解决问题.

I sometimes experience this while testing apps on devices, rebooting the device removes the corrupted one, solving the problem.

不过,我不知道是什么原因导致此第二个启动器图标损坏.

I don't know what causes this corrupt second launcher icon, though.

这篇关于Android应用程序创建两个启动器图标,而不是一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 14:03