is Airplane Mode Open - Android android.provider

Android examples for android.provider:Settings

Description

is Airplane Mode Open

Demo Code

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

public class Main {

  public static boolean isAirplaneModeOpen(Context context) {
    return getAirplaneModeState(context) == 1 ? true : false;
  }/*ww w.jav  a2  s  .  co m*/

  public static int getAirplaneModeState(Context context) {
    return Settings.System.getInt(context.getContentResolver(), Settings.System.AIRPLANE_MODE_ON, 0);
  }

}

Related Tutorials