2011-12-18 30 views
2

我有工作的Android應用程序,允許用戶通過標準的意向範例共享內容,但我的移植代碼不適用於Kindle Fire。在下面的代碼片段中,默認的Kindle電子郵件應用程序不會被識別爲意圖的處理程序。默認的Kindle電子郵件應用程序不在ACTION_SEND和ACTION_SEND的選擇列表中ACTION_SENDTO

下面給我「沒有應用程序可執行此操作」消息:

Intent intent = new Intent(android.content.Intent.ACTION_SENDTO); 
String uriText; 
uriText = "mailto:[email protected]"; 
Uri uri = Uri.parse(uriText); 
intent.setData(uri); 
startActivity(Intent.createChooser(intent, "Send email")); 

而且我在下面其他的嘗試,只是提出了Facebook和LastPass的作爲,可以處理文本/平原上唯一的應用程序。

Intent intent2 = new Intent(android.content.Intent.ACTION_SEND); 
intent2.putExtra(android.content.Intent.EXTRA_EMAIL, "[email protected]"); 
intent2.putExtra(android.content.Intent.EXTRA_SUBJECT, "Email subject"); 
intent2.putExtra(android.content.Intent.EXTRA_TEXT, "Email body text"); 
intent2.setType("text/plain"); 
startActivity(Intent.createChooser(intent2, "Send email")); 

有什麼想法?

感謝 邁克

+3

關閉袖口,感覺就像Kindle Fire電子郵件應用程序不太好。如果您可以將[AppXplore](http://developer.sonyericsson.com/wportal/devworld/technology/android/analysis-tools/appxplore?cc=gb&lc=en)這樣的工具加入到Fire中,則可以將其用於檢查清單並查看他們有哪些過濾器。 – CommonsWare 2011-12-18 21:57:38

+0

有趣的觀察:我安裝了K9郵件應用程序,然後運行上面的代碼。現在這兩種方法都會返回Kindle電子郵件應用程序和K9。在安裝K9之前,我嘗試過多次使用上面的代碼,但用戶錯誤聽起來是可能的。 – Mike 2011-12-19 19:23:13

+0

::將主題插入* Twilight Zone *此處:: – CommonsWare 2011-12-19 20:02:40

回答

3

,直到用戶創建一個郵件帳戶的電子郵件應用程序不註冊向意圖做出迴應。 某些第三方電子郵件客戶端會搶先註冊爲處理程序,但似乎內置選項僅在用戶創建了一個帳戶時纔會響應 - 通常不適合 - 其他客戶端如Twitter,Facebook或Skype會響應該事件

相關問題