I am using a button with id home_screen to set up an image in the framelayout fl_iv as homescreen wallpaper. But when i click on that, it sets up the image as both homescreen wallpaper and lockscreen wallpaper. How to make it just change the home wallpaper? The code goes as:
home_screen.setOnClickListener {
Toast.makeText(this@SetWallpaperActivity, "Please Wait. Setting Up", Toast.LENGTH_SHORT).show()
val result: Bitmap = fl_iv.drawToBitmap()
val wallpaperManager = WallpaperManager.getInstance(this)
try {
wallpaperManager.setBitmap(result)
} catch (ex: IOException) {
ex.printStackTrace()
}
Toast.makeText(this@SetWallpaperActivity, "All Done :)", Toast.LENGTH_SHORT).show()
}