Android Turn screen on, a way of notification


final AlertDialog alert = builder.create();

//Extra screen wake up notification
WindowManager.LayoutParams winParams =  alert.getWindow().getAttributes();
winParams.flags |= (WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
        | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
alert.getWindow().setAttributes(winParams);

alert.show();
Advertisements