Android中缺少启动器图标

时间:2015-09-14 12:49:24

标签: android icons manifest

当我执行应用程序时它运行完美,但问题是我无法在模拟器上的任何地方看到图标,我猜它必须与清单有关。

清单

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="org.cade"
    android:installLocation="auto"
    android:versionCode="1"
    android:versionName="CADE Codigos" >

    <uses-sdk
        android:minSdkVersion="7"
        android:targetSdkVersion="8" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS" />
    <uses-permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

    <uses-feature
        android:name="android.hardware.touchscreen"
        android:required="true" />

    <supports-screens
        android:anyDensity="true"
        android:largeScreens="true"
        android:normalScreens="true"
        android:smallScreens="true" />



    <application
        android:icon="@drawable/iconcopia"
        android:label="CADE Códigos" >

        <!-- android:debuggable="false" -->

        <activity
            android:name=".codigos.ui.activities.MainActivity"
            android:configChanges="keyboardHidden|orientation"
            android:label="CADE Códigos"
            android:launchMode="singleTask" >
            <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:scheme="http" />
                <data android:scheme="https" />
            </intent-filter>
        </activity>
        <activity
            android:name=".codigos.ui.activities.AboutActivity"
            android:label="@string/AboutActivity.Title"
            android:theme="@android:style/Theme.Dialog" />
        <activity
            android:name=".codigos.ui.activities.EditBookmarkActivity"
            android:label="@string/EditBookmarkActivity.Title"
            android:theme="@android:style/Theme.Dialog" />
        <activity android:name=".codigos.ui.activities.BookmarksListActivity" />
        <activity android:name=".codigos.ui.activities.HistoryListActivity" />
        <activity android:name=".codigos.ui.activities.DownloadsListActivity" />
        <activity android:name=".codigos.ui.activities.AdBlockerWhiteListActivity" />
        <activity
            android:name=".codigos.ui.activities.BookmarksHistoryActivity"
            android:configChanges="keyboardHidden|orientation" />
        <activity
            android:name=".codigos.ui.activities.ChangelogActivity"
            android:label="@string/ChangelogActivity.Title"
            android:theme="@android:style/Theme.Dialog" />
        <activity android:name=".codigos.ui.activities.preferences.PreferencesActivity" />
        <activity
            android:name=".codigos.ui.activities.preferences.HomepagePreferenceActivity"
            android:label="@string/HomepagePreferenceActivity.Title"
            android:theme="@android:style/Theme.Dialog" />
        <activity
            android:name=".codigos.ui.activities.preferences.SearchUrlPreferenceActivity"
            android:label="@string/SearchUrlPreferenceActivity.Title"
            android:theme="@android:style/Theme.Dialog" />
        <activity
            android:name=".codigos.ui.activities.preferences.UserAgentPreferenceActivity"
            android:label="@string/UserAgentPreferenceActivity.Title"
            android:theme="@android:style/Theme.Dialog" />
        <activity android:name=".codigos.ui.activities.MobileViewListActivity" />
        <activity android:name=".codigos.ui.activities.WeaveBookmarksListActivity" />
        <activity android:name=".codigos.ui.activities.preferences.WeavePreferencesActivity" />
        <activity
            android:name=".codigos.ui.activities.preferences.WeaveServerPreferenceActivity"
            android:label="@string/WeaveServerPreferenceActivity.Title"
            android:theme="@android:style/Theme.Dialog" />

        <provider
            android:name=".codigos.providers.ZircoBookmarksContentProvider"
            android:authorities="org.cade.codigos.providers.zircobookmarkscontentprovider" />
        <provider
            android:name=".codigos.providers.WeaveContentProvider"
            android:authorities="org.cade.codigos.providers.weavecontentprovider" />

        <receiver android:name=".codigos.utils.ProxyChangeReceiver" >
            <intent-filter>
                <action android:name="android.intent.action.PROXY_CHANGE" />
            </intent-filter>
        </receiver>

        <activity
            android:name=".codigos.ui.activities.RequestDataForm"
            android:label="@string/title_activity_request_data_form" >
        </activity>
    </application>

</manifest>

注意

如果您需要我的应用程序中的任何其他信息,我也会在此发布,非常感谢您提前。

1 个答案:

答案 0 :(得分:7)

您的主要活动需要添加启动器意图,类似这样。

   <activity
        android:name=".MainActivity"
        android:label="Title">
        <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:scheme="http" />
            <data android:scheme="https" />
        </intent-filter>
    </activity>