forked from github/cordova-android
CB-7261 Fix setNativeToJsBridgeMode sometimes crashing when switching to ONLINE_EVENT
This commit is contained in:
parent
73219bf2d2
commit
41125ea1e2
@ -321,12 +321,17 @@ public class NativeToJsMessageQueue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@Override void reset() {
|
final Runnable resetNetworkRunnable = new Runnable() {
|
||||||
|
public void run() {
|
||||||
online = false;
|
online = false;
|
||||||
// If the following call triggers a notifyOfFlush, then ignore it.
|
// If the following call triggers a notifyOfFlush, then ignore it.
|
||||||
ignoreNextFlush = true;
|
ignoreNextFlush = true;
|
||||||
webView.setNetworkAvailable(true);
|
webView.setNetworkAvailable(true);
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
@Override void reset() {
|
||||||
|
cordova.getActivity().runOnUiThread(resetNetworkRunnable);
|
||||||
|
}
|
||||||
@Override void onNativeToJsMessageAvailable() {
|
@Override void onNativeToJsMessageAvailable() {
|
||||||
cordova.getActivity().runOnUiThread(toggleNetworkRunnable);
|
cordova.getActivity().runOnUiThread(toggleNetworkRunnable);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user