Search code examples
javaandroidandroid-layoutandroid-holo-everywhere

Activity as Dialog Just On Larger Screen


I'm developing an Android app that needs to support 2.3+. I'm using HoloEverywhere as a layout library. My app runs perfectly on smartphones and tablets, but for now I'm using the same layout for all devices, so, in tablets there is a lot of blank space in a lot of layouts. So, I thinking if is possible to show this layout as a popup (AlertDialog) just on large screens.

I searched the internet for a response but every response I look isn't applying to my case. I don't want to change my layouts files (and, of course, I don't want to create new layout files).

Can anyone give a direction to solve my problem, or the unique way is to create new layouts for large screens?


Solution

  • You can use your own layout file as the content view of a dialog. With a custom view you can create other/bigger dialogs for your tablets. It is also possible to create a dialog from an activity. See http://developer.android.com/guide/topics/ui/dialogs.html#ActivityAsDialog or http://developer.android.com/guide/topics/ui/dialogs.html#FullscreenDialog