![](/img/trans.png)
[英]After launch calendar intent, how to “go ahead” with the app? Android
[英]A generic Intent to launch Calendar app on Android?
對於庫存的 Android ROM,我們可以通過以下方式啟動 Google 日歷應用:
Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setType("vnd.android.cursor.item/event");
intent.putExtra("title", "Some title");
intent.putExtra("description", "Some description");
startActivity(intent);
但是,看起來帶有自定義 UI 的制造商實現了他們自己的日歷,例如 HTC Sense UI。
我不確定 MotoBlur 和三星 TouchWiz,但我認為他們也在做同樣的事情。
所以,問題是:是否有一個通用的 Intent 我們可以用來在 Android 手機上啟動日歷應用程序(不管它是庫存 android 還是自定義 UI)? 或者我們需要編寫一個包裝器 class 來檢查和啟動適當的日歷?
當前沒有支持的日歷 API。 您所做的是依賴於私有實現細節(需要為 MIME 類型手動編寫字符串文字表明這一點),因此您將在不同的設備上獲得不同的行為,具體取決於它們的實現。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.