Android add event using event id with manual view in Calendar -
I want to add event manually
calendar startTime = Calendar.getInstance (); StartTime.set (2012, 0, 19, 7, 30); Calendar EndTime = Calendar.Just Instance (); Endtime.Set (2012, 0, 19, 8, 30); Intent = intent (intent.ACTION_INSERT) .setData (events. CONTENT_URI). Person (event ._id, 1). Posterior (calendar .content.EXTRA_EVENT_BEGIN_TIME, start time.get timeinimilis ()) .Upstata (calendar contract .EXTRA_EVENT_END_TIME, (Event.DEVIPTION, "Group Categories") .putExtra .putExtra (Events.ALL_DAY, False). Input Extra (Intent.EXTRA_EMAIL, "Rowan @Example.com, Traveler @ Example, Dr."); StartActivityForResult; Protected void onActivityResult (integer requestCode, integer resultCode, intent data), no value {// resultCode always 0. switch (requestCode) {case returns 1: if (resultCode == Activity.RESULT_OK) {}}}
Do I click "save" or "cancel" in the calendar application, resultCode always returns 0.
In addition to that I need to get the data intent. But back to the calendar, "Data" in OnActivityResult also offers zero.
Can anyone explain why this happens? Does the user click in any way to know "Save" or "Cancel" any other solution for this matter?
But want to add an event using the default page of the calendar with my Event ID.
If a solution resolves me
If you want to get a result for a particular code, intent
, Use startActivity
instead of startActivityForResult (intent, requestCode)
. Requestcode should be unique, and it should also be the request code that you are switching to onActivityResult
Comments
Post a Comment