Closed sellnat77 closed 10 years ago
If we do decide to force portrait we will be using this:
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize"
i will go with portrait only. but if you want to switch between both we need to do it programmatically like this:
Button buttonSetPortrait = (Button)findViewById(R.id.setPortrait); Button buttonSetLandscape = (Button)findViewById(R.id.setLandscape);
buttonSetPortrait.setOnClickListener(new Button.OnClickListener(){
public void onClick(View arg0) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } }); buttonSetLandscape.setOnClickListener(new Button.OnClickListener(){
public void onClick(View arg0) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); } });
Do we want to force a portrait orientation or allow the user to switch between portrait or landscape?