Thursday, February 11, 2010

Android - Modify Screen Orientation

The screen orientation is determined in the Activity class.

public class Test extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); //set screen orientation to landscape this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); ...code...

Done =)

[Via http://ykyuen.wordpress.com]

No comments:

Post a Comment