Questions tagged [android-window]
49 questions
1
vote
1 answer
View's getWindowToken() is null after windowManager.addView()
I have added the view by using WindowManager like this:
windowManager.addView(view, view.getViewParams());
Before and after this line I check view.getWindowToken() and it is always null.
Could you explain why view.getWindowToken() is null and when…

shmakova
- 6,076
- 3
- 28
- 44
1
vote
0 answers
Perform Explode animation without window transition
setting the window transition with
getWindow().setEnterTransition(new Explode());
getWindow().setExitTransition(new Explode());
but the result is weird, the window items are entering from a side of the window. It's like Explode() animation…

MJakhongir
- 2,101
- 2
- 16
- 27
1
vote
2 answers
How do I get screen height minus the actionbar?
When I have the phone in landscape I'm wondering how I can get the pixel height of the screen not including the actionbar. So the pixel height of the actual viewable area. I want this so I can size a GridLayout appropriately. The GridLayout is…

intA
- 2,513
- 12
- 41
- 66
1
vote
1 answer
Determine content area without navigation bar and status bar
An Android app uses full screen showing content behind the navigation bar, status bar, and toolbar. I'd like to have some contents not behind these bars. How to determine the area without these bars? As my understanding, the locations of some bars…

Hong
- 17,643
- 21
- 81
- 142
1
vote
1 answer
Dialog: dim everything except some region
In my application I'm displaying an image inside a dialog. If the user presses the button the dialog appears and takes 80% of the whole screen. The background will be dimmed because that is the default behavior of the Android Dialog.
Dialog dialog…

Deno Agüero
- 519
- 2
- 9
- 27
1
vote
2 answers
Using Picture-in-picture feature with Android O
I have created an android app to check the feature Picture In Picture mode of Android O.
But i facing an error while running this application.
setPictureInPictureArgs: Device doesn't support picture-in-picture mode
java.lang.IllegalStateException:…

Rahul M Mohan
- 293
- 1
- 3
- 12
0
votes
2 answers
Adjust UI when system bars are showing Android
I am using this code to hide the status bar and navigation bar from the app:
val windowInsetsController = WindowCompat.getInsetsController(window, window.decorView)
windowInsetsController.systemBarsBehavior =…

Groot
- 37
- 4
0
votes
0 answers
callback of registerForActivityResult when calling Activity is in background
I have something as a sequential call to two window/dialog activities B and C (A still remains visible in background)
A -> call for result B
A -> C
I want that whenever B responds and dialog is closed, C is finished as well. (let's say 2 dialogs…

htafoya
- 18,261
- 11
- 80
- 104
0
votes
0 answers
Jetpack Compose Keyboard adjustment
Is there a way where we can control for every screen different states of the keyboard, for example I have one screen where I want to adjust size of the keyboard to the screen and other screens where I do not want that. Currently I was using…

Svilen Rusev
- 309
- 4
- 15
0
votes
1 answer
Android. What is default alert dialog width
I use DialogFragment and Inside onCreateDialog return AlertDialog. In different devices my dialog width is different. What is default dialog width ? I don't understand what is default dialog window width. I didn't find any properties that define the…

testivanivan
- 967
- 13
- 36
0
votes
0 answers
Get actual offset of Android Dialog Window
Here is a simple alert dialog. Default gravity is center
AlertDialog.Builder alertBuild = new AlertDialog.Builder(MainActivity.this)
.setTitle("Sample Alert")
.setMessage("This is sample alert…

Akanksha Kapoor
- 25
- 5
0
votes
1 answer
NoSuchMethodError setDecorFitsSystemWindows when I use window?.setDecorFitsSystemWindows(true)
I want to make my Activity top to the screen, and the StatusBar transparent, so I write this code:
window?.setDecorFitsSystemWindows(true)
window?.statusBarColor = Color.TRANSPARENT
My targetVersion is 30
My appcompat version is 1.3.0
but when I…

kokod21
- 61
- 1
- 2
0
votes
1 answer
Options sub-menu goes off-screen when enabling FLAG_LAYOUT_NO_LIMITS
I am setting WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS flag in order to have the status bar overlapped with the ActionBar and I have an options menu with a sub-menu.. the problem appears when I hit the sub-menu item, then it shows off the…

Zain
- 37,492
- 7
- 60
- 84
0
votes
1 answer
Prevent changing window height
When showing the keyboard, the window height decreases and my layout is displayed incorrectly because of this.
UPD.

wpbloger
- 169
- 1
- 1
- 10
0
votes
2 answers
Color of status bar icons in Dialog's Window
This is the code which I use for changing color of status bar icon:
window.decorView.systemUiVisibility = if (light) {
View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
} else {
View.SYSTEM_UI_FLAG_VISIBLE
}
Unfortunately it does not work for Window…

Mariusz
- 1,825
- 5
- 22
- 36