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 int getActivityIconSize(Context c) { return 2 * ((ActivityManager) c.getSystemService(Context.ACTIVITY_SERVICE)).getLauncherLargeIconSize(); }
From source file:Main.java
public static AccountManager getManager(Context context) { return (AccountManager) context.getSystemService(Context.ACCOUNT_SERVICE); }
From source file:Main.java
public static ConnectivityManager getConnectivityManager(Context ctx) { return (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE); }
From source file:Main.java
public static int getMaxVolume(Context context) { return ((AudioManager) context.getSystemService(Context.AUDIO_SERVICE)) .getStreamMaxVolume(AudioManager.STREAM_MUSIC); }
From source file:Main.java
public static BluetoothManager getBluetoothManager(Context context) { return (BluetoothManager) context.getSystemService("bluetooth"); }
From source file:Main.java
public static ActivityManager getActivityManager(Context context) { return (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); }
From source file:Main.java
public static Object getSystemService(Context context, String serviceName) { return context.getSystemService(serviceName); }
From source file:Main.java
public static int getCurVolume(Context context) { return ((AudioManager) context.getSystemService(Context.AUDIO_SERVICE)) .getStreamVolume(AudioManager.STREAM_MUSIC); }
From source file:Main.java
private static ClipboardManager getClipboardManager(Context context) { return (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); }
From source file:Main.java
public static void showSoftInput(Context context) { ((InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE)) .toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); }