0

[設定]ボタンをクリックすると、ライブウォールアプリの強制が閉じます。

wall_setting.xml

    <?xml version="1.0" encoding="utf-8"?>
    <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">

<ListPreference 
        android:key="time_interval"
        android:title="@string/app_name"
        android:summary="something"
        android:defaultValue="3000" 
        android:entries="@array/updateInterval"
        android:entryValues="@array/updateIntervalValues"
    />

</PreferenceScreen> 

main.xml

<?xml version="1.0" encoding="utf-8"?>
<wallpaper xmlns:android="http://schemas.android.com/apk/res/android"
android:thumbnail="@drawable/ic_launcher"
android:settingsActivity="com.zacharia.lunar.WallService"
android:description="@string/wall_desc" />

マニフェスト.xml

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

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

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

    <service 
       android:name="com.zacharia.lunar.WallService"
       android:enabled="true"
       android:permission="android.permission.BIND_WALLPAPER">
        <intent-filter>
<action android:name="android.service.wallpaper.WallpaperService"></action>
        </intent-filter>
        <meta-data 
            android:name="android.service.wallpaper"
            android:resource="@xml/main"></meta-data>
    </service>
    <activity
        android:name="com.zacharia.lunar.SettingActivity"
        android:label="@string/title_activity_main" 
        android:theme="@android:style/Theme.Light.WallpaperSettings"
        android:exported="true">

    </activity>
</application>

</manifest>

エラー

InvocationTargetException 09-14 20:36:53.491:E / AndroidRuntime(542):com.android.wallpaper.livepicker.LiveWallpaperPreview.configureLiveWallpaper(LiveWallpaperPreview.java:113)09-14 20:36:53.491:E / AndroidRuntime(542) ):at java.lang.reflect.Method.invokeNative(Native Method)09-14 20:36:53.491:E / AndroidRuntime(542):at java.lang.reflect.Method.invoke(Method.java:521)09 -14 20:36:53.491:E / AndroidRuntime(542):android.view.View $ 1.onClick(View.java:2026)09-14 20:36:53.491:E / AndroidRuntime(542):..。 20 more 09-14 20:36:53.491:E / AndroidRuntime(542):原因:android.content.ActivityNotFoundException:明示的なアクティビティクラスが見つかりません{com.zacharia.lunar/com.zacharia.lunar.WallService}; AndroidManifest.xmlでこのアクティビティを宣言しましたか?09-14 20:36:53.491:E / AndroidRuntime(542):android.appで。

4

1 に答える 1

1

main.xml

    android:settingsActivity="com.zacharia.lunar.WallService"

読む必要があります。

    android:settingsActivity="com.zacharia.lunar.SettingActivity"
于 2012-09-14T15:26:26.307 に答える