No launcher found

143 views Asked by At

I have downloaded the code and imported, while I am running the code I got an error like No Launcher activity found! and The launch will only sync the application package on the device!.

I searched and got a solution that in manifest main and launcher action should be one after the other. I have done it but gain getting the same error and my app is not located in the emulator even though I am getting a message that "Wallpaper\bin\Wallpaper installed on device".

This is my manifest file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.wallpaper"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
         android:minSdkVersion="8"
         android:targetSdkVersion="17" />
    <uses-feature
        android:name="android.software.live_wallpaper"
        android:required="true" >
    </uses-feature>

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <service
            android:name="LiveWallpaperService"
            android:enabled="true"
            android:label="Wallpaper Example "
            android:permission="android.permission.BIND_WALLPAPER" >
            <intent-filter>
                <action android:name="android.service.wallpaper.WallpaperService" />
                <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/mywallpaper" >
            </meta-data>
        </service>
    </application>
</manifest>
2

There are 2 answers

0
MathanG On

You Cannot Set the intent filter Launcher and Main to the service. Only Activity can be launched. Add an Activity to start the service in your project and set the launcher and main intent-filter to the activity.

10
Akash Moradiya On

Define launcher activity like this,

<activity
    android:name=".yourlauncheractivity"
    android:screenOrientation="portrait"
    android:theme="@android:style/Theme.Light.NoTitleBar" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

& start your service in this launcher activity