Dalvik – snippet – force rotation to landscape

Here is a small snippet to use if you want to force screen to be displayed in landscape mode.

Place it before onCreate call.

.line 9
const/4 v0, 0x0

invoke-virtual {p0, v0}, Lcom/example/myapp/MainActivity;->setRequestedOrientation(I)V

Don’t forget to replace path to target activity. Here I used:

com/example/myapp/MainActivity

Leave a Reply

Your email address will not be published.




Enter Captcha Here :