Search code examples
androidandroid-dialogfragmentchrome-custom-tabs

How to open Chrome Custom Tab in a Dialog in Android Application


In my current Android application I have a requirement to open a DialogFragment to display a list of results.

Each Result has an associated url that explains the item in more detail.

I can open a Chrome Custom Tab with this url, however it closes the DialogFragment and the user has a poor experience.

Is it possible that I could open the Crome Custom Tab within its own Dialog?

That way my Results DialogFragment should not be closed, and the user can return directly to the results list.


Solution

  • Currently, a Custom Tab uses the entire screen, so it's not possible to use it in a similar way to a DialogFragment (which doesn't use the entire width/height of the screen).