Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
唐文
/
AiyoZhuaWaWa
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d1c73b0c
authored
Nov 10, 2017
by
chengfengpiaopiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决cokiee问题
parent
9be118fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
app/src/main/java/com/maile/jingcai/view/fragment/SimpleCardFragment.java
app/src/main/java/com/maile/jingcai/view/fragment/SimpleCardFragment.java
View file @
d1c73b0c
...
@@ -6,11 +6,13 @@ import android.os.Build;
...
@@ -6,11 +6,13 @@ import android.os.Build;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Handler
;
import
android.support.annotation.Nullable
;
import
android.support.annotation.Nullable
;
import
android.support.annotation.RequiresApi
;
import
android.support.v4.app.Fragment
;
import
android.support.v4.app.Fragment
;
import
android.util.Log
;
import
android.util.Log
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.webkit.CookieManager
;
import
android.webkit.JsResult
;
import
android.webkit.JsResult
;
import
android.webkit.WebChromeClient
;
import
android.webkit.WebChromeClient
;
import
android.webkit.WebSettings
;
import
android.webkit.WebSettings
;
...
@@ -75,6 +77,7 @@ public class SimpleCardFragment extends BaseFragment {
...
@@ -75,6 +77,7 @@ public class SimpleCardFragment extends BaseFragment {
}
}
//加载webview
//加载webview
@RequiresApi
(
api
=
Build
.
VERSION_CODES
.
LOLLIPOP
)
@SuppressLint
(
"AddJavascriptInterface"
)
@SuppressLint
(
"AddJavascriptInterface"
)
private
void
loadWebView
(
String
url
)
{
private
void
loadWebView
(
String
url
)
{
mWebView
.
setVisibility
(
View
.
VISIBLE
);
mWebView
.
setVisibility
(
View
.
VISIBLE
);
...
@@ -101,6 +104,10 @@ public class SimpleCardFragment extends BaseFragment {
...
@@ -101,6 +104,10 @@ public class SimpleCardFragment extends BaseFragment {
WebView
.
setWebContentsDebuggingEnabled
(
true
);
WebView
.
setWebContentsDebuggingEnabled
(
true
);
}
}
if
(
Build
.
VERSION
.
SDK_INT
>
Build
.
VERSION_CODES
.
KITKAT
)
{
CookieManager
.
getInstance
().
setAcceptThirdPartyCookies
(
mWebView
,
true
);
}
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN
){
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN
){
mWebView
.
getSettings
().
setAllowUniversalAccessFromFileURLs
(
true
);
mWebView
.
getSettings
().
setAllowUniversalAccessFromFileURLs
(
true
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment