[Android] Setting screen orientation programmatically


import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.os.Bundle;

public class Orientation extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

//---change to landscape mode---
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}
}

Comments

Popular posts from this blog

Solution to Kindle stuck in USB Drive Mode even when Ejected

Input Numbers with Kindle Keyboard without using the Symbol key

Qubes OS 3.2 - clamav in untrusted and/or vault domain