This is my code in Kotlin so far but I am unaware of how to enable the outside display to show an activity while the phone is unfolded and the main activity is shown on the inner display. I know it must be possible because the Samsung Camera app is able to do it.
I was trying to follow Google’s documentation here but with not much luck.
https://developer.android.com/guide/topics/ui/foldables#multi-display
val dm = getSystemService(Context.DISPLAY_SERVICE) as DisplayManager
val displays = dm.displays
The number of displays always shows 1 and no more even though the Z Fold 2 has 2, so I am not sure.