java - Android:如何使用谷歌语音启动调用 Intent ?

标签 java android

如何使用 Google Voice 启动特定 Intent (例如调用)?如何使用 Intent 传递电话号码?以下代码启动谷歌语音,但是使用谷歌语音作为 Intent 附加进行调用时要传递什么值?

final Intent intent = new Intent();
intent.setComponent(new ComponentName("com.google.android.apps.googlevoice", "com.google.android.apps.googlevoice.activity.conversationlist.ConversationListActivity"));

intent.putExtra("label", "<phone number>");

startActivity(intent);

这里我应该在标签中添加什么来启动使用谷歌语音发起调用的 Intent ? 感谢任何帮助...提前致谢...

最佳答案

永远不要像这样直接定位应用程序,除非它在你的包中。您应该使用 Intent 过滤器来捕获该特定应用程序。有时您必须以这样的应用程序为目标,但这会带来包名称错误更改的风险。

要处理您的特定应用程序,您需要了解信息如何传递到 Google 语音中。这将为您提供洞察力以及如何定位确切的包名称。

关于java - Android:如何使用谷歌语音启动调用 Intent ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9059871/

相关文章:

android - Jetpack compose dialogFragment 等效

java - 我可以使用 java.util.LinkedList 构造循环/循环链表吗?

java - Java中的文件到字节[]

java - 当根项目不包含任何类时,Sonar/findbugs 失败

android - 如果 ConstraintLayout 中的文本太长,TextView 会超出 Constraint

java - 从 Assets 文件中解析 XML

java - Android 通讯录 - 获取电话号码

Android 应用程序未安装到设备上

java - 为什么恢复下载会下载 Java 应用程序中损坏的文件?

java - Websphere 消息队列多线程