1

我正在将一个应用程序转换为 Android 运行时,但是我的一些 Intent 操作不起作用,LogCat 上没有显示错误/异常。我可以看到我的 onSaveInstanceState 代码正在运行,就好像 Activity 被暂停一样,但什么也没出现。当使用 IntentChooser 时,我可以在日志中看到:“invoking onCreate() for Activity com.android.internal.app.ChooserActivity”,但是在 PlayBook 上,没有任何反应。在 BB10 模拟器上,出现了选择器(即带有消息和 SMS 选项),但单击它们时没有任何反应。这些应该工作吗?可能有什么问题?文档没有提到任何这些限制:http: //developer.blackberry.com/android/apisupport/

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))
4

2 回答 2

2

实际上它已经提到了一些你正在使用的 Intent 是不允许的。

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)

希望您参考此文档页面。他们在那里提到了您在问题中提到的ACTION_VIEWACTION_SEND 。

但他们没有提到如何克服这个问题。

于 2013-02-01T08:56:16.393 回答
1

在文档: 不支持的 BlackBerry 10 API 中, 您可以找到 BlackBerry Runtime for Android 应用程序在 BlackBerry 10 上不支持的功能。

请参阅:意图

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)
于 2013-06-14T15:34:16.573 回答