calendar onReceive EVENT_REMINDER

Put your problem here if it does not fit any of the other categories.

calendar onReceive EVENT_REMINDER

Postby GrandFunk » Fri Jul 12, 2013 5:31 pm

I have created a broadcastreceiver to hook calendar EVENT_REMINDER and to get info about event
Code: Select all
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    bReceiver = new HealtDroidBroadcastReceiver();
    IntentFilter inf = new IntentFilter("android.intent.action.EVENT_REMINDER");
    inf.addDataScheme("content");
    inf.addDataAuthority("com.android.calendar",null);
    registerReceiver(bReceiver,inf);
}

in Broadcastreceiver class:
Code: Select all
public void onReceive(Context context, Intent intent) {
    Uri uri = intent.getData();
    String intentAction = intent.getAction();
    ContentResolver cr = context.getContentResolver();
   
    Cursor alertCursor = cr.query(uri, ALERT_PROJECTION,
            null /* selection */, null, null /* sort order */);


but I have an error when cr.query:

unknown URL content://com.android.calendar/1373401980000
GrandFunk
Once Poster
Once Poster
 
Posts: 1
Joined: Fri Jul 12, 2013 5:23 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 18 guests