2012-12-11 50 views
1

我正在將一個應用程序轉換爲Android Runtime,但是我的一些Intent操作不起作用,LogCat上沒有顯示任何錯誤/異常。我可以看到我的onSaveInstanceState代碼正在運行,就好像活動正在暫停一樣,但什麼都沒有出現。 當使用IntentChooser時,我可以在日誌中看到:「爲Activity com.android.internal.app.ChooserActivity調用onCreate()」,但是在PlayBook上,沒有任何反應。在BB10模擬器上,選擇器出現(即使用消息和短信選項),但點擊時沒有任何反應。 這些應該是工作?什麼可能是錯的?該文檔沒有提到任何這些限制:http://developer.blackberry.com/android/apisupport/BlackBerry Android Runtime上不支持的內容

working: 
new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI) - (contact picker) 
new Intent(MediaStore.ACTION_IMAGE_CAPTURE) - (camera pick image) 

not working: 
new Intent(android.content.Intent.ACTION_SEND) - (send e-mail) 
new Intent(Intent.ACTION_GET_CONTENT) - (pick media from device) 
new Intent(Intent.ACTION_VIEW) - (file/document preview) 
new Intent(Intent.ACTION_CALL) - (calling phone number - have proper permissions) 


Calling them with either below yields same results. 
context.startActivity(intent) 
context.startActivity(Intent.createChooser(intent)) 

回答

2

其實已經提到了一些正在使用不允許的意圖的。

Android applications cannot provide system-wide services to the rest of the device. E.g: 
Dialing services (handling android.intent.action.ACTION_DIAL) 
Viewing capabilities (system-wide handing of android.intent.action.ACTION_VIEW) 
Data sharing capabilities (android.intent.action.ACTION_SEND) 

希望你引用這個documentation page。在那裏他們提到了你在問題中提到的大約ACTION_VIEWACTION_SEND

但他們沒有提到如何解決這個問題。

1
文件中

Unsupported APIs for BlackBerry 10 你能找到不是由黑莓運行Android應用程序在黑莓手機支持的功能10.

參見:Intents

Android應用程序不能提供全系統服務到設備的其餘部分 。例如:

Dialing services (handling android.intent.action.ACTION_DIAL) 
Viewing capabilities (system-wide handing of android.intent.action.ACTION_VIEW) 
Data sharing capabilities (android.intent.action.ACTION_SEND)