Max
Max

Reputation: 186

Using a string for an Android intent putExtra() method

I am using an Android intent to create a calendar event. Do all intent extras have string names? For example, instead of using

.putExtra(CalendarContract.Events.TITLE, "New event")

I can use:

.putExtra("title", "New event")

Is there something like that for all intent extras? For example, instead of using CalendarContract.EXTRA_EVENT_BEGIN_TIME, is there a string literal I can use? Or maybe I'm way off, and the "title" is not actually working the way I expect it to?

I have looked over calendar intent documentation several times, as well as the documentation on putExtra() and general intent documentation, as well as several StackOverflow posts, but I can't figure it out. Thanks in advance!

Upvotes: 0

Views: 121

Answers (1)

Manohar
Manohar

Reputation: 23394

for CalendarContract.EXTRA_EVENT_BEGIN_TIME its beginTime .

You can ctrl+click to see each string respective name in android studio .

Also it is not recommended to use hardcoded string always use CalendarContract.Events.TITLE instead of title

Upvotes: 1

Related Questions