Questions tagged [android-displaymanager]
20 questions
14
votes
0 answers
How Can We Get an Activity Shown Using setLaunchDisplayId() to be Landscape?
In this sample project, my MainActivity has code to launch a separate activity on an external display, using setLaunchDisplayId() on ActivityOptions:
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
…

CommonsWare
- 986,068
- 189
- 2,389
- 2,491
5
votes
0 answers
Changing primary display resolution programmatically
I'm trying to change the display resolution of my primary display on Android 8.1. I get an event from the kernel (based on EDID) that tells me I need to change mode.
I then basically do:
sp…

anr78
- 1,308
- 2
- 17
- 31
3
votes
1 answer
How to detect screen mirroring in android when my mobile screen is shared using teams presentation?
For enhanced security of My Android App, I need to detect the screen mirrioring. I have implemented this below source code:
var display : DisplayManager = getSystemService(DISPLAY_SERVICE) as DisplayManager
var presentationdisplay=…

Pravs2311
- 31
- 2
3
votes
0 answers
How to display other app in surface view?
I would like to mirror e.g. Waze in my app SurfaceView:
Intent intent = getPackageManager().getLaunchIntentForPackage("com.waze"); //"com.waze"
Bundle opts = ActivityOptions
.makeBasic()
…

Idemax
- 2,712
- 6
- 33
- 66
1
vote
3 answers
How to read current screen orientation on Android?
I would like to read current screen orientation on Android using Jetpack Compose.
I already tried following in a @Composable:
val o = LocalActivity.current.requestedOrientation
val o = LocalContext.current.display.rotation
val o =…

Ralf Wickum
- 2,850
- 9
- 55
- 103
1
vote
0 answers
How to switch the secondary display back to the mirror mode after start an Activity
I configured a secondary display for my android device. By default, the secondary display will mirror the content of the main diaplsy.
Then I use DisplayManager.getDisplays(DisplayManager.DISPLAY_CATEGORY_PRESENTATION) to get secondary displayId…

陈朝勇
- 23
- 4
1
vote
0 answers
How to read display resolution thorugh HDMI? DisplayCompat fine on AndroidTV directly, but not on an AndroidTV Stick
Since AndroidTV scales down the UI for UHD/4K resolution TV devices, DisplayMetrics always return 1920x1080 for these higher resolution devices.
One workaround is DisplayCompat:
On many Android TV devices, Display.Mode may not report the accurate…

Murat
- 11
- 2
1
vote
1 answer
How to read the real native physical display resolution on Android TV?
I am trying to read the real physical display resolution on my Android TV device. I have two testing TVs:
FullHD with 1920 x 1080 resolution
UHD with 3840 x 2160 resolution
and 1 Android TV HDMI stick with Android 9.
I would like to read out the…

Edna Krabappel
- 362
- 1
- 2
- 16
1
vote
0 answers
From drawable canvas position to WindowManager matrix or Display matrix in Android?
I'm trying to make a blinker for my calculator app. I have created the blinker using a view that fades in and out. I can position the blinker where it needs to be in some device densities but not in others.
I create a drawable to draw the math…

i_o
- 777
- 9
- 25
1
vote
0 answers
How to divide activity view into two display/screen
I am working on android automotive,
I need to divide activity view into two parts like half view in primary display and another half view in RSE(Rear-Seat) display.
May i know how to do?
which part/API of AOSP need to look?.

ask
- 69
- 1
- 8
1
vote
0 answers
How to specify the layerStack for a VirtualDisplay created by DisplayManager?
According to android's official document:
virtual displays
Virtual displays may share the same set of layers as the main display (the layer stack) or have their own set.
It is known that DisplayManager.createVirtualDisplay() can create a virtual…

progquester
- 1,228
- 14
- 23
0
votes
1 answer
Facing issue While making dynamic views using Relative layout
I'm using relative layout for building the views/grid dynamically...
ex: if there is 1 user then,
[grid with users 1]1
if there is 2 user then ,
[grid with users 2]2
if there is 3 user then,
[grid with user 3]3
if there are 4 user then ,
2 above and…

IRON MAN
- 191
- 3
- 18
0
votes
0 answers
Display Manager can't detect huawei phones's screen recorder
On huawei phones DisplayManager.getDisplays() can see the screen recording of 3rd party applications. But when I open the huawei device's own screen recording application, DisplayManager cannot detect it.
I use getDisplays() method (Gets all…

serlok17
- 25
- 4
0
votes
0 answers
Android. How to get the bounds of the area associated with this window?
I have code to get the bounds of the area associated with this window:
context.getSystemService(WindowManager::class.java).currentWindowMetrics.bounds
But this code requires API level 30, my min is 21.
Is it possible to do the same but for api 21…

testivanivan
- 967
- 13
- 36
0
votes
0 answers
How to control secondary screen with my app on primary screen in Android?
I am developing an application to control the secondary display using the buttons in my application. My app will run on the primary screen and I want to send the navigation and selection key events to the secondary screen through my controller app…

suspended_null
- 1
- 3