Stop Reload Android Webview On Same URL Before

Summary:
Because it is react, the url could be changed on redirection or some other ways.
The iOS version's WebView has controled that on [here](https://github.com/facebook/react-native/blob/master/React/Views/RCTWebView.m#L106).
But the Android's one is not.

Check the url is same with privous url. If it is true, cancel loading.
This logic is same with iOS's.

the ```method``` hasn't compared.

Test urls as we can.
The Google Map(https://map.google.com) was one of the site which has occur error before this commit.

related issue : #9121
Closes https://github.com/facebook/react-native/pull/9126

Differential Revision: D3663685

Pulled By: javache

fbshipit-source-id: f38c9012ee077677543dafcea83c0778a4471bfa
This commit is contained in:
Nam Se Hyun 2016-08-03 17:36:09 -07:00 committed by Facebook Github Bot 4
parent 0093dcc9c5
commit 9fa4fe2fa5
1 changed files with 4 additions and 0 deletions

View File

@ -329,6 +329,10 @@ public class ReactWebViewManager extends SimpleViewManager<WebView> {
}
if (source.hasKey("uri")) {
String url = source.getString("uri");
String previousUrl = view.getUrl();
if (previousUrl != null && previousUrl.equals(url)) {
return;
}
if (source.hasKey("method")) {
String method = source.getString("method");
if (method.equals(HTTP_METHOD_POST)) {