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
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=…
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() …
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…
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…
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…
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…
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…
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…
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…
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…
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…
1
2