Setting wallpaper instantly with setbitmap() andro

2019-09-11 02:24发布

问题:

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.