get Screen Mode - Android android.app

Android examples for android.app:Screen

Description

get Screen Mode

Demo Code

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

public class Main {

  private static int getScreenMode(Context context) {
    int screenMode = 0;
    try {//from  w w w  . j  ava2  s.  co m
      screenMode = Settings.System.getInt(context.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE);
    } catch (Exception localException) {

    }
    return screenMode;
  }

}

Related Tutorials