I have used the following code to keep the screen on in android devices.Here is the code
getWindow().addFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
But it didn't work on Samsung Tab4 .Is there any alternate code for keeping the screen on in this tab? Kindly share the cod eif you know.thanks in advance.