我开发了气泡字典式动态壁纸,并且可以正常工作,但是当我在移动android画布上更改方向时,它给出了error illegal argument exception
,因此我希望壁纸服务具有固定的方向。任何人都可以帮助我如何确定动态壁纸服务的方向,我的Manifest
文件没有orientation
服务标签屏幕,所以请告诉我该怎么做
<application
android:icon="@drawable/icon"
android:label="@string/app_name" >
<service
android:name="com.packageService.android.samplesV1.SampleLiveWallpaperService"
android:label="@string/liveWallpaper"
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/sample_livewallpaper" />
</service>
<activity
android:name="com.packageService.android.samplesV1.ColorSettings"
android:exported="true"
android:label="Settings"
android:screenOrientation="portrait" >
</activity>
</application>
我找不到用于服务的屏幕方向更改的解决方案,但是如果我们想删除异常非法参数异常,请在finally块中进行跟踪(只需holder.unlockCanvasAndPost(canvas);
放入try and catch块中)
finally {
if (canvas != null) {
try {
holder.unlockCanvasAndPost(canvas);
}
catch (Exception e) {
e.printStackTrace();
}
}
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句