対象の Activity で下記対応をする
if (isPhone(getApplicationContext())) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
...
public static boolean isPhone(Context context) {
Configuration configuration = context.getResources().getConfiguration();
if (configuration.smallestScreenWidthDp < 600) {
return true;
}
return false;
}
android:screenOrientation のリファレンスはこちら