xxxxxxxxxx
<activity
android:screenOrientation="nosensor">
xxxxxxxxxx
//put this <
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
// > In your MainActivity.java
xxxxxxxxxx
<!-- inside of your AndroidManifest.xml -->
<activity android:name=".MainActivity"
android:screenOrientation="portrait"/>