-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add 增加 onPageStarted() 和 onReceivedSslError()
- Loading branch information
1 parent
7677d27
commit 2557712
Showing
3 changed files
with
58 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
ByWebView/src/main/java/me/jingbin/web/OnByWebClientCallback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,31 @@ | ||
package me.jingbin.web; | ||
|
||
import android.graphics.Bitmap; | ||
import android.net.http.SslError; | ||
import android.webkit.SslErrorHandler; | ||
import android.webkit.WebView; | ||
|
||
/** | ||
* Created by jingbin on 2020/6/30. | ||
*/ | ||
public abstract class OnByWebClientCallback { | ||
|
||
public void onPageStarted(WebView view, String url, Bitmap favicon) { | ||
|
||
} | ||
|
||
public void onPageFinished(WebView view, String url) { | ||
|
||
} | ||
|
||
public boolean isOpenThirdApp(String url) { | ||
return !url.startsWith("http:") && !url.startsWith("https:"); | ||
} | ||
|
||
/** | ||
* @return true 表示是自己处理的 | ||
*/ | ||
public boolean onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters