android cordova plugin works on an emulator but not in phone
<p>I build this plugin for cordova in android. It is working on my emulator perfectly. But when i install my app on my phone and tried to run my plugin I get an error "No activity found to handle intent {act= android.intent.action.INSERT dat=content://com.android.calendar/events(has extras)}". Here is my java class </p>

<pre><code> package com.myPlugins;

import java.util.Calendar;

import org.apache.cordova.api.CallbackContext;
import org.apache.cordova.api.CordovaPlugin;
import org.apache.cordova.api.Plugin;
import org.apache.cordova.api.PluginResult;
import org.json.JSONArray;


import android.content.Intent;
import android.net.Uri;
import android.provider.CalendarContract;
import android.provider.CalendarContract.Events;
import android.util.Log;

@SuppressWarnings("deprecation")
public class CalendarPlugin extends Plugin {
    public static final String ACTION_STRING = "addToCalendar";
    public static final String PARAMETER = "success";



@Override
public PluginResult execute(String action, JSONArray data, String callback) {
    if (ACTION_STRING.equals(action)){
         Log.d("HelloPlugin", "Hello, this is a native function called from PhoneGap/Cordova!"); 



        Calendar beginTime = Calendar.getInstance();



        Uri uri = Uri.parse("content://com.android.calendar/events");
        Intent intent = new Intent("android.intent.action.INSERT",uri);

        try{
            String [] calendarData = data.getString(0).split(",");

            //parse trough calendar date and time
            String [] dateTime = calendarData[4].split(":");
            String [] date = dateTime[0].split("-");
            beginTime.set(Integer.valueOf(date[0]), Integer.valueOf(date[1]), Integer.valueOf(date[2].substring(0, 2)), Integer.valueOf(dateTime[1]), Integer.valueOf(dateTime[2]));


            intent.putExtra(Events.TITLE, calendarData[1]);
            intent.putExtra(CalendarContract.EXTRA_EVENT_ALL_DAY, true);
            intent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, beginTime.getTimeInMillis());
            intent.putExtra(CalendarContract.EventsEntity.EVENT_LOCATION, calendarData[5] + calendarData[6] + calendarData[7]);
            intent.putExtra(CalendarContract.EventsEntity.DESCRIPTION, calendarData[8]);

        }
        catch (Exception e){
            Log.d("JSONArray",   "Error:" + e);
            return new PluginResult(PluginResult.Status.ERROR, "Error with Calendar Plugin:" + e.getMessage());
        }


        this.ctx.startActivity(intent); 

        return new PluginResult(PluginResult.Status.OK, "Success!");

    }
    return new PluginResult(PluginResult.Status.ERROR, "Error with Calendar Plugin");
}
</code></pre>

<p>}</p>
