Reputation: 42828
I know I can specific application orientation (Portrait or Landscape) through manifest file.
My application will run on both tablets and phones. However, currently, I would like to have Landscape
orientation for tablet application, and Portrait
for phone application.
May I know, how I can achieve this, by only having to build a single APK file. Or, do I need 2 different APK files for tablets and phones?
Upvotes: 0
Views: 218
Reputation: 23010
put this in onCreate method:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_NOSENSOR);
sets the orientation to device default.
Upvotes: 4