I have used this code as @gnobal posted on https://stackoverflow.com/a/2700683/1556329 and it works great. But my issue is that I have found that when I apply Theme.Transpar
I have theme with android:windowIsTransluent
and rotation stops. To turn it ON i have experiment by adding screenOrientation="sensor"
for application, theme and first Activity. Adding rotation only for first Activity turn rotation on for all activities in application.
If you set android:windowIsTranslucent
or android:windowIsFloating
to true
rotation notifications are disabled (as long as you don't force them to be enabled with android:screenOrientation="sensor"
).
you may check out this
android:screenOrientation="sensor"
or
android:screenOrientation="user"
add one of them to your manifest <activity............../>
.
and don't forget to add this to your application in manifest as well if you wish to avoid recreating your activity android:configChanges="keyboardHidden|orientation|screenSize"
I had the same problem. Before doing any solutions, first be sure that rotation feature is enabled and then check your home screen that can be rotate, if no, Reboot your phone and the problem will be solved!