2011-03-18 32 views
11

我正在創建一個Intent以從我的應用程序創建新的日曆活動。我想弄清楚如何指定什麼應該在日曆項目的「Where」字段中,以便我可以在其中放置一個地址,但我所嘗試的操作不起作用。有誰知道什麼Android - 如何用意圖調用日曆時指定位置?

//Create our intent 
Intent intent = new Intent(Intent.ACTION_EDIT); 
intent.setType("vnd.android.cursor.item/event"); 
intent.putExtra("title", myTitle); 
intent.putExtra("description", myDescription); 
//Trying to get the where to wrk 
intent.putExtra("where", myAddress); 
startActivity(intent); 

我試過設置「在哪裏」如上所示,但是這是行不通的。

+0

請務必用[code]標籤格式化你的代碼,請。 – 2011-03-18 13:49:21

回答

26

位置字段是 「eventLocation」

intent.putExtra("eventLocation", myAddress) 
+0

這很好。謝謝。 – Chris 2011-03-26 13:51:03

相關問題