我寫了個視頻作為動態壁紙的服務,然后想關掉動態壁紙,stop、kill都殺不死,自由手動在手機上結束運行才能關閉,這是怎么了?
附上啟動服務代碼
intentser = new Intent(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER);
intentser.putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT, new ComponentName(context, VideoWall.class));
context.startActivity(intentser);
再附上注冊服務代碼:
<service
android:name=".VideoLiveWallpaper"
android:label="@string/app_name"
android:permission="android.permission.BIND_WALLPAPER"
android:process=":wallpaper">
<!-- 配置intent-filter -->
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
</intent-filter>
<!-- 配置meta-data -->
<meta-data
android:name="android.service.wallpaper"
android:resource="@xml/dywalls" />
</service>
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/104789.html
標籤:Android
