Example usage for android.app WallpaperManager FLAG_LOCK

List of usage examples for android.app WallpaperManager FLAG_LOCK

Introduction

In this page you can find the example usage for android.app WallpaperManager FLAG_LOCK.

Prototype

int FLAG_LOCK

To view the source code for android.app WallpaperManager FLAG_LOCK.

Click Source Link

Document

Flag: set or retrieve the lock-screen-specific wallpaper.

Usage

From source file:com.maxwen.wallpaper.board.fragments.dialogs.WallpaperApplyFragment.java

@Override
public void onClick(View view) {
    int id = view.getId();
    int applyFlag = -1;
    if (id == R.id.apply_all) {
        applyFlag = WallpaperManager.FLAG_LOCK | WallpaperManager.FLAG_SYSTEM;
    } else if (id == R.id.apply_home) {
        applyFlag = WallpaperManager.FLAG_SYSTEM;
    } else if (id == R.id.apply_lock) {
        applyFlag = WallpaperManager.FLAG_LOCK;
    }//from  w ww .j  a va2s  . c om

    if (applyFlag != -1) {
        WallpaperHelper.doApplyWallpaper(getContext(), mRect, mColor, mUrl, mName, applyFlag);
    }
    dismiss();
}