get Brightness Mode - Android android.provider

Android examples for android.provider:Settings

Description

get Brightness Mode

Demo Code

import android.content.Context;
import android.provider.Settings;

public class Main {

  static public int getBrightnessMode(Context context) {
    int brightnessMode = Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL;
    try {//from   w  ww  .j a v  a  2s.  co m
      brightnessMode = Settings.System.getInt(context.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE);
    } catch (Exception e) {
      e.printStackTrace();
    }
    return brightnessMode;
  }

}

Related Tutorials