ログイン資格情報を持つ Web アプリケーションがあります。この Web アプリケーションを Android にロードしていますWebView
。正常に動作しています。問題は、アプリケーションを閉じてタブのアプリケーションランチャーアイコンをクリックした後、常にログインページが表示されることです。しかし、ログインページは必要ありません。ログインしてアプリケーションを閉じ、ランチャーアイコンをクリックすると、ログインページの直後に開きたいです。
これが私のコードです:
public class MyActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
try {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
WebView webview = (WebView)findViewById(R.id.webview);
WebSettings settings = webview.getSettings();
settings.setSupportMultipleWindows(true);
settings.setJavaScriptCanOpenWindowsAutomatically(true);
webview.getSettings().setJavaScriptEnabled(true);
webview.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
});
webview.loadUrl("http://192.1xx.x.xxx:8280/login.jsp");
} catch(Exception e) {
}
}