List of usage examples for android.app WallpaperManager getWallpaperInfo
public WallpaperInfo getWallpaperInfo()
From source file:arun.com.chameleonskinforkwlp.MainActivity.java
/** * Prompt the user to set our app as live wallpaper if the user has not set it. */// w w w .jav a2 s . com private void initSetWallpaperPrompt() { final WallpaperManager wm = WallpaperManager.getInstance(getApplicationContext()); if ((wm.getWallpaperInfo() != null && wm.getWallpaperInfo().getPackageName().equalsIgnoreCase(getPackageName()))) { // We are good } else { // Ask user. Snackbar.make(binding.coordinatorLayout, R.string.set_live_wallpaper_promt, Snackbar.LENGTH_INDEFINITE) .setAction(android.R.string.ok, new View.OnClickListener() { @Override public void onClick(View v) { launchSetWallpaperScreen(); } }).show(); } }