2012-03-05 7 views
1

android 2.3.3バージョンでonConfigurationChanged()をオーバーライドしました。 Land-ScapeをPortraintに変更したとき、その向きは変更されましたが、PortraitからLandscapeに変更されることはありません。 方向を[縦]から[横]に変更してください。android 2.3.3バージョンでonConfigurationChanged()を使用する方法

public void onConfigurationChanged(Configuration newConfig) { 
     super.onConfigurationChanged(newConfig); 

     int orientation = this.getResources().getConfiguration().orientation; 

     if (orientation == Configuration.ORIENTATION_PORTRAIT) { 
      setContentView(R.layout.settings); 
     } else if (orientation == Configuration.ORIENTATION_LANDSCAPE) { 
      setContentView(R.layout.settings); 
     } 


    } 
+0

http://stackoverflow.com/questions/9566305/orientation- 2 3-3-3関連しています。エミュレータでのみ問題が発生しているようです。http://code.google.com/p/android/issues/detail?id=13189 – Nishant

答えて

0

Related Question

マニフェストは、あなたが起動している活動のためのエントリを、次のしていることを確認してください。エミュレータ上で

android:configChanges="orientation|keyboardHidden 

、それはあなたが向きを変えたら、それは以前のものに戻っていないということが起こる可能性があるためのthis bug

関連する問題