Skip to content

Commit

Permalink
修正错误
Browse files Browse the repository at this point in the history
  • Loading branch information
sky42550564 committed Mar 29, 2017
1 parent ac87afa commit f8751da
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions android/src/main/java/com/remobile/cordova/CordovaInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Licensed to the Apache Software Foundation (ASF) under one
public class CordovaInterface {
private ExecutorService threadPool;
private CordovaPlugin plugin;
protected CordovaPlugin activityResultCallback;
protected CallbackMap permissionResultCallbacks;
protected int activityResultRequestCode = -1;

Expand All @@ -53,23 +52,13 @@ public Activity getActivity() {
}

public void startActivityForResult(CordovaPlugin command, Intent intent, int requestCode) {
setActivityResultCallback(command);
try {
getActivity().startActivityForResult(intent, requestCode + plugin.requestCodeStart);
} catch (RuntimeException e) { // E.g.: ActivityNotFoundException
activityResultCallback = null;
throw e;
}
}

public void setActivityResultCallback(CordovaPlugin plugin) {
// Cancel any previously pending activity.
if (activityResultCallback != null) {
activityResultCallback.onActivityResult(activityResultRequestCode, Activity.RESULT_CANCELED, null);
}
activityResultCallback = plugin;
}

public void setActivityResultRequestCode(int requestCode) {
activityResultRequestCode = requestCode;
}
Expand Down

0 comments on commit f8751da

Please sign in to comment.