How can I retrieve last inserted calender event id using Intents?
<p>I'm wondering how to retrieve event id after saving it.</p>

<pre><code>public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
    try {
        if (ACTION_ADD_TO_CALENDAR.equals(action)) { 
            JSONObject arg_object = args.getJSONObject(0);
            callback = callbackContext;
            Intent calIntent = new Intent(Intent.ACTION_EDIT)
                .setType("vnd.android.cursor.item/event")
                .putExtra("beginTime", arg_object.getLong("startTimeMillis"))
                .putExtra("endTime", arg_object.getLong("endTimeMillis"))
                .putExtra("title", arg_object.getString("title"))
                .putExtra("description", arg_object.getString("description"))
                .putExtra("eventLocation", arg_object.getString("eventLocation"))
                .putExtra("allDay", true)
                .putExtra("hasAlarm", true);
            this.cordova.startActivityForResult(this, calIntent, RESULT_CODE_CREATE);
            return true;
        }
    } catch(Exception e) {
        System.err.println("Exception: " + e.getMessage());
        return false;
    }     
    return false;
}

public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if(requestCode == RESULT_CODE_CREATE) {
        if(resultCode == Activity.RESULT_OK) {
            long eventId = Long.parseLong(data.getData().getLastPathSegment());
            callback.success(eventId + "");
        } else {
            callback.error("Activity result code " + resultCode);
        }
    } 
}
</code></pre>

<p>I don't know why I got error in callback function and I have to use intents,so any body can help!</p>
