2013-11-28 52 views

回答

4

以下內容添加到您的AndroidManifest:

android:configChanges="orientation|keyboard|keyboardHidden|screenSize" 

因此,它應該是這個樣子:

<activity android:name=".MyActivity" 
     android:label="@string/app_name" 
     android:configChanges="orientation|keyboard|keyboardHidden|screenSize"> 

顯然,如果你的WebView需要鍵盤支持那麼不要包含鍵盤選項。

+0

thanx man .. !!你也是對的..謝謝 –

+0

@RishiKumar歡迎來... – Piyush

0
@Override 
public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setRetainInstance(true); 

} 
+0

沒有'setRetainInstance'方法 – AlexioVay

0
@Override 
    protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState);    
     ... 
     ... 
     ... 


     if (savedInstanceState != null) { 
      mWebView.restoreState(savedInstanceState); 
     } else {  
      mWebView.loadUrl(); 
     } 
    } 
相關問題