本文整理汇总了Java中org.apache.cordova.api.CordovaPlugin.onActivityResult方法的典型用法代码示例。如果您正苦于以下问题:Java CordovaPlugin.onActivityResult方法的具体用法?Java CordovaPlugin.onActivityResult怎么用?Java CordovaPlugin.onActivityResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cordova.api.CordovaPlugin
的用法示例。
在下文中一共展示了CordovaPlugin.onActivityResult方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onActivityResult
import org.apache.cordova.api.CordovaPlugin; //导入方法依赖的package包/类
protected void onActivityResult(int paramInt1, int paramInt2, Intent paramIntent)
{
LOG.d(TAG, "Incoming Result");
super.onActivityResult(paramInt1, paramInt2, paramIntent);
Log.d(TAG, "Request code = " + paramInt1);
ValueCallback localValueCallback = this.appView.getWebChromeClient().getValueCallback();
if (paramInt1 == 5173)
{
Log.d(TAG, "did we get here?");
if (localValueCallback == null)
return;
if ((paramIntent != null) && (paramInt2 == -1))
break label187;
}
CordovaPlugin localCordovaPlugin1;
label187: for (Object localObject = null; ; localObject = paramIntent.getData())
{
Log.d(TAG, "result = " + localObject);
localValueCallback.onReceiveValue(localObject);
localCordovaPlugin1 = this.activityResultCallback;
if (localCordovaPlugin1 != null)
break label196;
if (this.initCallbackClass == null)
break;
this.activityResultCallback = this.appView.pluginManager.getPlugin(this.initCallbackClass);
CordovaPlugin localCordovaPlugin2 = this.activityResultCallback;
LOG.d(TAG, "We have a callback to send this result to");
localCordovaPlugin2.onActivityResult(paramInt1, paramInt2, paramIntent);
return;
}
label196: LOG.d(TAG, "We have a callback to send this result to");
localCordovaPlugin1.onActivityResult(paramInt1, paramInt2, paramIntent);
}
示例2: onActivityResult
import org.apache.cordova.api.CordovaPlugin; //导入方法依赖的package包/类
@Override
/**
* Called when an activity you launched exits, giving you the requestCode you started it with,
* the resultCode it returned, and any additional data from it.
*
* @param requestCode The request code originally supplied to startActivityForResult(),
* allowing you to identify who this result came from.
* @param resultCode The integer result code returned by the child activity through its setResult().
* @param data An Intent, which can return result data to the caller (various data can be attached to Intent "extras").
*/
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
LOG.d(TAG, "Incoming Result");
super.onActivityResult(requestCode, resultCode, intent);
Log.d(TAG, "Request code = " + requestCode);
ValueCallback<Uri> mUploadMessage = this.appView.getWebChromeClient().getValueCallback();
if (requestCode == CordovaChromeClient.FILECHOOSER_RESULTCODE) {
Log.d(TAG, "did we get here?");
if (null == mUploadMessage)
return;
Uri result = intent == null || resultCode != Activity.RESULT_OK ? null : intent.getData();
Log.d(TAG, "result = " + result);
// Uri filepath = Uri.parse("file://" + FileUtils.getRealPathFromURI(result, this));
// Log.d(TAG, "result = " + filepath);
mUploadMessage.onReceiveValue(result);
mUploadMessage = null;
}
CordovaPlugin callback = this.activityResultCallback;
if(callback == null && initCallbackClass != null) {
// The application was restarted, but had defined an initial callback
// before being shut down.
this.activityResultCallback = appView.pluginManager.getPlugin(initCallbackClass);
callback = this.activityResultCallback;
}
if(callback != null) {
LOG.d(TAG, "We have a callback to send this result to");
callback.onActivityResult(requestCode, resultCode, intent);
}
}