Hi! I have found two ways on keeping the screen on:
First one is simpler:
getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
Second one is using a wakelock and requiring an extra permission:
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK, "DoNotDimScreen");
Is there any real difference between this two methods apart from the second one being more complicated to implement and requiring an extra permission? Will the end result be always the same?