Setting wallpaper instantly with setbitmap() android

痞子三分冷 提交于 2019-12-14 04:10:00

问题


I have been searching for an answer to my problem, but cant seem to find a right answer.

I am trying to use tasker to set a background on my phone everytime a song changes. I got everything working, but setbitmap does not set wallpaper instantly. I have to interact with the phone in some way to get it to update ( open a folder, touch the screen etc). Is there a way to force an update after setbitmap has been called?

Edit: Im using setStream now. Here is a short video showing what im trying to explain in detail.

Wallpaper delay

Thanks!


回答1:


Is your permission in place ?

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


Alternatively you can use setStream instead of setBitmap as it takes time to decode a bitmap and it is directly proportional to the size of the bitmap.



来源:https://stackoverflow.com/questions/39270919/setting-wallpaper-instantly-with-setbitmap-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!