如何将执行方法的结果传递给 onActivityResult ,以便添加永远不会直接返回应用的日历事件,而是在添加事件后转到日历。
public boolean execute(String action, JSONArray args, CallbackContext callbackContext)
哪个电话
startActivityForResult(this, calIntent, RESULT_CODE_CREATE);
致
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
---->>How to access something generated as result from execute method here<<------
答案 0 :(得分:0)
onActivityResult
开始的活动时,将调用 startActivityForResult
。您可以调用setResult(int, Intent)
(在finish()之前)方法来传回结果。
编辑:示例:
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) {
Intent data = new Intent();
putExtra("key", "value");
setResult(1000, data);
finish();
}
调用onActivityResult时,您将获得Intent
(第三个参数)中的数据