Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Disable screen rotation when screen smaller than x

Anyone know how can I disable screen rotation in my Android app when screen is smaller than (for example) 480px? I'm building app using phonegap witch will be targeted to tablet devices, but it's also possible to run it on smart-phones. Unfortunately application is only displayed properly when app is displayed in landscape orientation...

like image 904
PsychoX Avatar asked Feb 23 '23 00:02

PsychoX


1 Answers

Maybe an 'if' controlled

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

in the onCreate function?

like image 50
Howard Hodson Avatar answered Mar 08 '23 05:03

Howard Hodson