Reputation: 318
All,
I am searching for an component i.e the Android Event creation/add screen in the calendar.The component looks like the one in the image below. No problem which ever the OS version it may be. I wanna achieve the way this standard android event screen can be called within an app. iOS provides this kind of feature, does android also do?
Thanks, In advance!
Upvotes: 0
Views: 610
Reputation: 551
Write the below code in your event Onclicklistner
Calendar cal = Calendar.getInstance();
Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setType("vnd.android.cursor.item/event");
intent.putExtra("beginTime", cal.getTimeInMillis());
intent.putExtra("allDay", true);
intent.putExtra("rrule", "FREQ=YEARLY");
intent.putExtra("endTime", cal.getTimeInMillis()+60*60*1000);
intent.putExtra("title", "A Test Event from android app");
startActivity(intent);
Upvotes: 1