use of android.support.annotation.RequiresApi in project TumCampusApp by TCA-Team.
the class SilenceService method requestPermissionsSDK23.
@RequiresApi(Build.VERSION_CODES.M)
private static void requestPermissionsSDK23(Context context) {
Intent intent = new Intent(Settings.ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS);
context.startActivity(intent);
}
use of android.support.annotation.RequiresApi in project glide by bumptech.
the class RequestManagerRetrieverTest method testDoesNotThrowIfAskedToGetManagerForActivityPreJellYBeanMr1.
@Test
@RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public void testDoesNotThrowIfAskedToGetManagerForActivityPreJellYBeanMr1() {
Util.setSdkVersionInt(Build.VERSION_CODES.JELLY_BEAN);
Activity activity = Robolectric.buildActivity(Activity.class).create().start().resume().get();
Activity spyActivity = Mockito.spy(activity);
when(spyActivity.isDestroyed()).thenThrow(new NoSuchMethodError());
assertNotNull(retriever.get(spyActivity));
}
use of android.support.annotation.RequiresApi in project run-wallet-android by runplay.
the class NotificationHelper method createNotificationChannel.
@RequiresApi(api = Build.VERSION_CODES.O)
private static void createNotificationChannel(Context context) {
NotificationManager notificationManager = context.getSystemService(NotificationManager.class);
NotificationChannel channel = new NotificationChannel(NOTIFICATION_CHANNEL, context.getResources().getString(R.string.app_name), NotificationManager.IMPORTANCE_MIN);
notificationManager.createNotificationChannel(channel);
}
use of android.support.annotation.RequiresApi in project AlarmAndJob by dxsdyhm.
the class TostServiceHelper method initScedule.
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public static void initScedule(Context context) {
JobScheduler jobScheduler = (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE);
JobInfo jobInfo = new JobInfo.Builder(1, new ComponentName(context.getPackageName(), ToastJobService.class.getName())).setPeriodic(SCEDULE_TIME).setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY).setRequiresCharging(true).build();
jobScheduler.schedule(jobInfo);
}
use of android.support.annotation.RequiresApi in project tutorial-view by msayan.
the class TutorialActivity method changeStatusBarColor.
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
private void changeStatusBarColor(int backgroundColor) {
Window window = getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(backgroundColor);
}
Aggregations