mirror of
https://github.com/shuto-cn/cordova-plugin-inappbrowser.git
synced 2026-05-04 00:00:06 +08:00
android端添加返回方法
This commit is contained in:
@@ -337,6 +337,20 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
pluginResult.setKeepCallback(true);
|
||||
this.callbackContext.sendPluginResult(pluginResult);
|
||||
}
|
||||
else if(action.equals("back")){
|
||||
this.cordova.getActivity().runOnUiThread(new Runnable() {
|
||||
@SuppressLint("NewApi")
|
||||
@Override
|
||||
public void run() {
|
||||
if(canGoBack()) {
|
||||
goBack();
|
||||
} else {
|
||||
closeDialog();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user