Enable js in login webview

This commit is contained in:
seven332 committed 2015-03-26 19:59:14 +08:00
1 parent fd7ea32942
commit 6b6c50f8cc
1 file changed
+19 -1
@@ -1,5 +1,22 @@
/*
* Copyright (C) 2015 Hippo Seven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hippo.ehviewer.ui;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.webkit.CookieManager;
import android.webkit.WebView;
@@ -14,12 +31,13 @@ public class WebViewLoginActivity extends AbsActivity {
public static final String KEY_ERROR = "error";
@SuppressLint("SetJavaScriptEnabled")
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
CookieManager.getInstance().removeAllCookie();
WebView wv = new WebView(this);
wv.getSettings().setJavaScriptEnabled(true);
wv.setWebViewClient(new LoginWebViewClient());
wv.loadUrl(EhClient.LOGIN_URL);
setContentView(wv);