Eclipse显示未找到启动器活动

时间:2013-12-11 10:39:49

标签: android xml android-manifest

这是我的android Manifest.xml。

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="uk.co.halfninja.wallpaper.parallax">

    <uses-sdk android:minSdkVersion="7" />
    <uses-feature android:name="android.software.live_wallpaper" />

    <application
        android:label="@string/app_name"
        android:icon="@drawable/icon">


        <service
            android:label="@string/app_name"
            android:name=".ParallaxWallpaper"
            android:permission="android.permission.BIND_WALLPAPER">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <meta-data android:name="android.service.wallpaper" android:resource="@xml/wallpaper" />
        </service>
        <activity
            android:label="@string/wallpaper_settings"
            android:name=".ParallaxWallpaperSettings"
            android:theme="@android:style/Theme.Black.NoTitleBar"
            android:exported="true">
        </activity>

    </application>
</manifest>

仍然Eclipse显示结果

 ParallaxWallpaper] No Launcher activity found!
 ParallaxWallpaper] The launch will only sync the application package on the device!
 ParallaxWallpaper] Performing sync
 ParallaxWallpaper] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.

请让我知道我在哪里犯这个错误,解决方案是什么...... ???

3 个答案:

答案 0 :(得分:0)

intent-filter代码从service移至activity

答案 1 :(得分:0)

这些行应位于活动代码

 <application
    android:label="@string/app_name"
    android:icon="@drawable/icon">
    <activity
        android:label="@string/wallpaper_settings"
        android:name=".ParallaxWallpaperSettings"
        android:theme="@android:style/Theme.Black.NoTitleBar"           android:exported="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
     </activity>

    <service
        android:label="@string/app_name"
        android:name=".ParallaxWallpaper"
        android:permission="android.permission.BIND_WALLPAPER">
    </service>

    <meta-data android:name="android.service.wallpaper" android:resource="@xml/wallpaper" />

 </application>

答案 2 :(得分:0)

将活动作为启动器,您已将服务作为启动器。像那样

 <activity
        android:label="@string/wallpaper_settings"
        android:name=".ParallaxWallpaperSettings"
        android:theme="@android:style/Theme.Black.NoTitleBar"
        android:exported="true">
   <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

    </activity>