2011-03-16 34 views

回答

2

清單文件android:configChanges="orientation|keyboardHidden"這裏

<activity android:name=".imgview" 
        android:configChanges="orientation|keyboardHidden" 
        android:label="@string/app_name"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 

和其中u可以覆蓋重新加入這一行。在我的職務是更新時listItems和其他一些功能:例如

public void onConfigurationChanged(Configuration newConfig) { 
     super.onConfigurationChanged(newConfig); 
     Log.e("ScreenMode",""+screenMode); 
     if(screenMode==1) 
     {Log.e("ScreenMode",""+screenMode); 
      buildUrl(result,startPage); 
      showImageList(); 
     } 

     if(screenMode==2) 
     { 
      showOneImage(forFunc); 
     } 
     if(screenMode==0) 
     { 
      startOMG(); 
     } 
    } 
+0

謝謝彼得 – 2011-03-16 12:55:25

0

要避免遇到重新使用android:configChanges="keyboardHidden|orientation"AndroidManifestActivity

+0

感謝您的幫助 – 2011-03-16 13:01:14

相關問題