How to add more than one fragment on presentation display?

My question comes from the use case that my android device is connected to 4K TV through HDMI. By default, it mirrors and upscales the content of my android device to 4K TV. The video quality is not ideal. I would like to use presentation mode to recreate the same content based on 4K resolution.

My app has multiple fragments. So naturally, I would like to find a way to re-use all of these fragments on presentation. I had done one fragment on presentation smoothly based on the following library. However, I am having difficulties to add the second fragment on presentation.

Based on the library cwac-presentation, I can create two fragments of webview on presentation, (for example, one webview for google.com, another for yahoo.com), but only the last one is shown. the previous one is somehow hidden. If unplugged HDMI, both fragments are shown on android local screen.

In theory, I could rewrite all my code using one fragment on presentation, that would be too much work.

Is there any limit on presentation? Or any suggestions to show two fragments on presentation?

BTW, I also look into MirrorPresentationFragment. My understanding it does upscaling instead of re-generating content. It would be ideal to re-generate the content based on 4K resolution. Is my understanding correct?

Presentation itself knows nothing about fragments. PresentationFragment is a fragment. You could try nested ordinary fragments inside of a PresentationFragment using getChildFragmentManager(), I suppose — I have never tried that, but AFAIK it should work.

It simply shows what is showing from the mirrored content. Whether that is upscaled or downscaled depends on the size of the source and the size of the display. Mostly, it is for cases where you want the same content on both the mobile device screen (for input) and on the external display (for an audience to see the output).

Thank you very much for your suggestions. While two fragments on presentation don’t work, nestedPresentationFragment works. I suspect there can only be one root view on presentation. But nestedPresentationFragment solves the problem. I just made an empty root layout then put two of my fragment into it.

For mirrored fragment, I am not sure how it is different from screen mirroring, which does the same scaling (up/down). My goal is to reach higher/native resolution on presentation and my fragments are complex too. Scaling is not helpful.

It would be ideal that I can just run the second set of instance of my fragments in presentation. So far I believe nestedPresentationFragment is my approach. Thanks.

Screen mirroring mirrors the entire screen. What I offer is basically “view mirroring”, for mirroring part of a screen. It is not designed for your scenario.

But nestedPresentationFragment solves the problem.

Glad to hear it!