List of usage examples for android.content Context getSystemService
@SuppressWarnings("unchecked") public final @Nullable <T> T getSystemService(@NonNull Class<T> serviceClass)
From source file:Main.java
public static AlarmManager getAlarmManager(Context context) { return (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); }
From source file:Main.java
public static WifiManager getWifiManager(Context pContext) { return (WifiManager) pContext.getSystemService("wifi"); }
From source file:Main.java
private static AppOpsManager getAppOpsManager(Context context) { return (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE); }
From source file:Main.java
private static AlarmManager am(Context context) { return (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); }
From source file:Main.java
public static int getDisplayWidth(Context context) { return ((WindowManager) context.getSystemService("window")).getDefaultDisplay().getWidth(); }
From source file:Main.java
public static int getScreenWidth(Context context) { return ((WindowManager) context.getSystemService("window")).getDefaultDisplay().getWidth(); }
From source file:Main.java
private static int getMemoryClass(Context context) { return ((ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE)).getMemoryClass(); }
From source file:Main.java
public static void cancelAllNotification(Context context) { ((NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE)).cancelAll(); }
From source file:Main.java
public static TelephonyManager getTelephonyManager(Context context) { return (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); }
From source file:Main.java
public static int getDisplayHeight(Context context) { return ((WindowManager) context.getSystemService("window")).getDefaultDisplay().getHeight(); }