Basically I'm making a wallpapers application, when changing the wallpaper or background only changes the one on the home screen, but the blocking screen does not, I've searched in different forums but I can not find a correct solution.
Code where I get the Bitmap from an XML on a server:
URL url = new URL(url_down);
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
connection.connect();
img = BitmapFactory.decodeStream(connection.getInputStream());
if (colocarWallpaper) {
WallpaperManager wallpaperManager = WallpaperManager.getInstance(getApplicationContext());
try {
wallpaperManager.setBitmap(img);
} catch (Exception error) {
Log.e("prueba", "colocar wall error: " + error);
}
return null;
}....
Thanks in advance for the collaboration.
// SOLUTION
if (colocarWallpaper) {
WallpaperManager wallpaperManager = WallpaperManager.getInstance(getApplicationContext());
int flag_lock = WallpaperManager.FLAG_LOCK;
try {
wallpaperManager.setBitmap(img);
wallpaperManager.setBitmap(img, null, true, flag_lock);//**
} catch (Exception error) {
Log.e("prueba", "colocar wall error: " + error);
}
** Using the WallpaperManager and with this line I can make the background change of the lock screen by passing the img (Bitmap)