When you no more need to keep the screen on, simply remove the flags that keep your screen on Window window = getWindow(); window.clearFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED| WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON); ...

I solved it after doing research, i am posting the referred link. Answer Link Here's my solution to my problem and it worked perfectly. I added these runnable classes in my background thread (run method). And after sleeping i could clear the flag to keep the screen on. runOnUiThread(new Runnable()...

Instead of using AlertDialog and assigning static dimensions and X|Y references on screen, I would suggest you to make use of PopupMenu which is available in API-11 and above. As for older APIs, you may use support-v7 library. For example and more info, read this and this. Moreover, if the...

I solve my problem. add flag'WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE' to WindowManager.LayoutParams in every view,and then all view will be worked~

I think this is because you are adding your ViewPager directly via the WindowManager. Doing so means that it won't be part of the normal Activity view hierarchy (i.e. a child of the decor view). Activity.findViewById (which traverses views using the decor view as the root) won't be able to...

I also did something like that and i can manage to do it in onWindowsFocusChanged function. Code is below, I know that you already tried it but maybe you can find something useful from it. @Override public void onWindowFocusChanged(boolean hasFocus) { // TODO Auto-generated method stub super.onWindowFocusChanged(hasFocus); AnimationSet set =...