landscape mode in tablet only

omega picture omega · Apr 26, 2011 · Viewed 8.3k times · Source

My app has to support landscape/portrait mode only for tablets, phones will only support portrait mode. What is the best way to implement this?

Options that I am considering:

a) using two apk files, one for phones and one for tablets. The one for phone will lock landscape mode in the manifest

2) using one apk file. Detect that device is a phone, lock landscape mode inside each activity.

any advice will be appreciated.

Regards

Answer

Daniel Argüelles picture Daniel Argüelles · Jun 21, 2012

You can use a SuperClass for activities and implement this https://stackoverflow.com/a/9629127/710162 on, for example, onCreate().