Created
February 24, 2015 18:00
-
-
Save Kozlov-V/4e91659eb0110c309b0e to your computer and use it in GitHub Desktop.
To create always-top fullscreen overlay activity in Android
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final WindowManager.LayoutParams params = new WindowManager.LayoutParams( | |
WindowManager.LayoutParams.FLAG_FULLSCREEN, | |
WindowManager.LayoutParams.FLAG_FULLSCREEN, | |
WindowManager.LayoutParams.TYPE_SYSTEM_ALERT, | |
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN, | |
PixelFormat.TRANSLUCENT); | |
WindowManager wm = (WindowManager) getApplicationContext() | |
.getSystemService(Context.WINDOW_SERVICE); | |
ViewGroup mTopView = (ViewGroup) App.inflater.inflate(R.layout.main, null); | |
getWindow().setAttributes(params); | |
wm.addView(mTopView, params); |
Здравствуйте! Я очень рад, что это помогло.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you. You code thanked me a lot. I have been searching for this code for last 4 days and i was at the edge of giving hope. Thank you so much