1

I have livewallpaper, settings activity for livewallpaper and also standard MainActivity. The point is that livewallpaper can't works with MainActivity together. When my manifest looks like this:

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

<application android:icon="@drawable/icon"
    android:label="simea">
    <!-- >android:permission="android.permission.BIND_WALLPAPER">-->

     <service android:name=".LiveWallpaper"
        android:label="@string/app_name"
        android:icon="@drawable/icon">

        <intent-filter>
            <action android:name="android.service.wallpaper.WallpaperService" />
        </intent-filter>
        <meta-data android:name="android.service.wallpaper"
            android:resource="@xml/livewallpaper" />
    </service> 

    <activity android:name=".MainActivity"
    android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity android:label="@string/livewallpaper_settings"
        android:name=".LiveWallpaperSettings"
        android:theme="@android:style/Theme.Light.WallpaperSettings"
        android:exported="true"
        android:icon="@drawable/icon">
    </activity>

</application>

I can run MainActivity, but I can't bind livewallpaper with my homescreen. I see preview of livewallpaper and I can change settings, but when I click "set wallpaper" button, there's no effect.

When I uncomment this line:

<!-- >android:permission="android.permission.BIND_WALLPAPER">-->

and comment this:

<uses-permission android:name="android.permission.BIND_WALLPAPER"/>

livewallpaper works great on my homescreen, but when I try to run MainActivity I get toast with message like this: "app is not installed on your phone". How can I fix it?

klimat
  • 24,711
  • 7
  • 63
  • 70
  • 2
    accept some answers dude!! for your reputation and for the users to be motivated to answer your questions – iTurki Jan 11 '12 at 14:12
  • 1
    I don't know if it's what causes the problem, but I think you should move the BIND_WALLPAPER permission into the service-tag – Jave Jan 11 '12 at 14:26
  • I'll post it as an answer so people will know then ;) – Jave Jan 11 '12 at 14:39

1 Answers1

6

the android:permission="android.permission.BIND_WALLPAPER" should be placed inside the service tag:

 <service android:name=".LiveWallpaper"
    android:label="@string/app_name"
    android:icon="@drawable/icon"
    android:permission="android.permission.BIND_WALLPAPER">
Jave
  • 31,598
  • 14
  • 77
  • 90