Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can we know that the user clicked the save button in calendar to create an event or the cancel button?
    primarykey
    data
    text
    <pre><code>Intent intent = new Intent(Intent.ACTION_INSERT) .setData(Events.CONTENT_URI) .putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, beginTime.getTimeInMillis()) .putExtra(CalendarContract.EXTRA_EVENT_END_TIME, endTime.getTimeInMillis()) .putExtra(Events.TITLE, title) .putExtra(Events.DESCRIPTION,desc ) .putExtra(Events.EVENT_LOCATION, loc) .putExtra(Events.AVAILABILITY, Events.AVAILABILITY_BUSY); </code></pre> <p>I used this code for adding event.I don't want to use insertion using ContentValues because it will not give the user a chance to select his calendar.So how can i know that user has pressed the save or cancel button?PLZZZZZZ HELP</p> <pre><code>startActivityForResult(intent,RESULT_CANCELED); </code></pre> <p>As per your suggestions I used this to start the calendar activity and below is my onActivityResult callback.</p> <pre><code> @Override public void onActivityResult(int req,int res,Intent intent){ if(RESULT_OK==res){ Toast.makeText(getApplicationContext(), "Resuming Activity",Toast.LENGTH_LONG).show(); Toast.makeText(getApplicationContext(),"Created Event number:"+String.valueOf(getLastEventID()), Toast.LENGTH_LONG).show(); addReminder(getLastEventID()); } else if(RESULT_CANCELED==res){ Toast.makeText(getApplicationContext(), "No events added",Toast.LENGTH_LONG).show(); } } </code></pre> <p>Now the problem is that on pressing DONE or CANCEL,both the times Toast appears showing "No events added".This means that DONE and CANCEL returns RESULT_CANCELED.Please check it....</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload