当我点击动态壁纸设置选项的应用程序崩溃 [英] Application is crashing when i click settings option in live wallpaper
问题描述
没有张贴在logcat.Application刚刚停止工作。
这里是我的code格式清单
Nothing is posted in logcat.Application just stops working. Here is my code form manifest
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<service android:name =".LiveWallpaperAndroid"
android:label = "@string/app_name"
android:icon = "@drawable/ic_launcher"
android:permission = "android.permission.BIND_WALLPAPER" >
<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:label="@string/livewallpaper_settings"
android:name=".LiveWallpaperSettings"
android:theme="@android:style/Theme.Light.WallpaperSettings"
android:exported="true"
android:icon = "@drawable/ic_launcher">
</activity>
</application>
下面是我的设置活动code
Below is my settings Activity code
public class LiveWallpaperSettings extends PreferenceActivity
implements SharedPreferences.OnSharedPreferenceChangeListener
{
@Override
protected void onCreate(Bundle icicle)
{
super.onCreate(icicle);
getPreferenceManager().setSharedPreferencesName(LiveWallpaperScreen.SHARED_PREFS_NAME);
addPreferencesFromResource(R.xml.football);
getPreferenceManager().getSharedPreferences()
.registerOnSharedPreferenceChangeListener(this);
}
有关设置我的XML文件
My xml file for settings is
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/livewallpaper_settings"
android:key="livewallpaper_settings">
<ListPreference
android:key="livewallpaper_testpattern"
android:title="@string/livewallpaper_settings_title"
android:summary="@string/livewallpaper_settings_summary"
android:entries="@array/livewallpaper_testpattern_names"
android:entryValues="@array/livewallpaper_testpattern_prefix"/>
<CheckBoxPreference android:key="livewallpaper_movement"
android:summary="@string/livewallpaper_movement_summary"
android:title="@string/livewallpaper_movement_title"
android:summaryOn="Moving test pattern"
android:summaryOff="Still test pattern"/>
</PreferenceScreen>
什么是错的我这儿过得无法拿出任何东西,因为在有关任何错误的logcat上什么都没有。
What is wrong here.I am unable to come up with anything because nothing is shown in logcat about any error.
推荐答案
它会出现很多时间陪我也是,我知道这个问题,解决好了,我想你忘记了你的xml文件夹wallpaper.xml改变你的包名文件,只要勾选下面你有你的answeres。
it occur many time with me also, i know this problem and solution well,i think you just forgot to change your package name in you xml folder wallpaper.xml file, just check following you got your answeres.
我想你wallpaper.xml //你懂什么你把你的文件名
i think you wallpaper.xml // you understand your file name whatever you take
<?xml version="1.0" encoding="utf-8"?>
<wallpaper xmlns:android="http://schemas.android.com/apk/res/android"
android:settingsActivity="YourAllPAckageName.YourSettingActivity"
android:thumbnail="@drawable/ic_launcher" />
喜欢,
<?xml version="1.0" encoding="utf-8"?>
<wallpaper xmlns:android="http://schemas.android.com/apk/res/android"
android:settingsActivity="com.wallpaperexample.WallpaperSettingsActiity"
android:thumbnail="@drawable/ic_launcher" />
这篇关于当我点击动态壁纸设置选项的应用程序崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!