Skip to content

Snappy1

  • Home
  • Android
  • What
  • How
  • Is
  • Can
  • Does
  • Do
  • Why
  • Are
  • Who
  • Toggle search form

[FIXED] android – Issue in wallpapermanager in kotlin

Posted on November 11, 2022 By

Solution 1 :

Try specifying FLAG_SYSTEM in your wallpaper manager

wallpaperManager.setBitmap(result, null, true, WallpaperManager.FLAG_SYSTEM)

Problem :

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([email protected], "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([email protected], "All Done :)", Toast.LENGTH_SHORT).show()


        }

Comments

Comment posted by Vipul Sharma

I tried that but it says that it requires android api level 24 to call this funtion but the minimum set is 22. i was previously using wallpaperManager.setBitmap(result) , it managed to change both home screen and lock screen as low as api 22, so i think there should be a way to a home screen change alone in api 22 and above

READ  [FIXED] Routing between two points in Mapbox (Android)
Powered by Inline Related Posts
Android Tags:android, android-studio, kotlin, wallpaper

Post navigation

Previous Post: [FIXED] How to get Firebase auth token in Android login
Next Post: [FIXED] android – what should be the input and output forom of variables for float object detection model

Related Posts

[FIXED] Android automatically Capture selfie on face detection and display in image view Android
[FIXED] android – kotlin findViewById returns null Android
[FIXED] java – i’m getting this following error when trying to make a video call. Also added the debug log Android
[FIXED] c# – Xamarin Forms FlyOut Menu Not Showing on ContentViews Unless Access Through Menu Android
[FIXED] android – How not to show user that is online in recyclerview Android
[FIXED] android studio – org.gradle.tooling.model.UnsupportedMethodException: Unsupported method: AndroidArtifact.getBuildConfigFields() Android

Archives

  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuándo
  • ¿Cuántas
  • ¿Cuánto
  • ¿Qué
  • Android
  • Are
  • At
  • C'est
  • Can
  • Comment
  • Did
  • Do
  • Does
  • Est-ce
  • Est-il
  • For
  • Has
  • Hat
  • How
  • In
  • Is
  • Ist
  • Kann
  • Où
  • Pourquoi
  • Quand
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welchen
  • Welcher
  • Welches
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Who's
  • Why
  • Wie
  • Will
  • Wird
  • Wo
  • Woher
  • you can create a selvedge edge: You can make the edges of garter stitch more smooth by slipping the first stitch of every row.2022-02-04
  • you really only need to know two patterns: garter stitch

Recent Posts

  • Can Vicks humidifier be used without filter?
  • What color is Spanish green?
  • How old is Jamie in The War That Saved My Life?
  • When should I use scalp massager for hair growth?
  • Can I put polyurethane over liming wax?

Recent Comments

No comments to show.

Copyright © 2023 Snappy1.

Powered by PressBook Grid Dark theme