[問題] 根據Calendar event ID讀取資料
假如我已經知道event ID
如何根據id讀取這個event的資料?
目前網路上查到的資訊都是直接根據id修改事件
或者用query搜尋整個calendar
不知道有沒有比較直接的方式?
本來我想利用inent的getStringExtra(),不過讀取到的都是null
int eventId = 123; //舉例
Uri uri = ContentUris.withAppendedId(Events.CONTENT_URI, eventId);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
String str = intent.getStringExtra(Events.TITLE);
if (str != null)
Log.v(TAG, str);
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.66.243.96
※ 文章網址: https://www.ptt.cc/bbs/AndroidDev/M.1441094928.A.667.html
→
09/01 17:01, , 1F
09/01 17:01, 1F
→
09/01 21:13, , 2F
09/01 21:13, 2F
→
09/01 21:13, , 3F
09/01 21:13, 3F
→
09/01 23:00, , 4F
09/01 23:00, 4F