0

What's the difference between using WallpaperManager.getInstance(context) and (WallpaperManager) context.getSystemService(Context.WALLPAPER_SERVICE)?

If I open source code for getInstance() method, it returns (WallpaperManager) context.getSystemService(Context.WALLPAPER_SERVICE), so obviously there is no difference. But according to this answer, using getInstance() solved OP's problem. Also, docs suggest using getSystemService().

Which approach is better and why?

Mladen
  • 2,070
  • 1
  • 21
  • 37

1 Answers1

0

As i see it, the main difference is: due to getInstance() is static method, this instance created only once, all the subsequent times this instanсe is used. So when you call static getInstance(), you probably use already created instance.

Hetfieldan24
  • 198
  • 11