android - 分享意向不给我一个选择

标签 android

我正在开发一个应用程序,我想在其中通过 facebook、twitter、gmail、消息或 share intent 提供的更多选项共享我的数据,只需转到此代码即可。 .

     Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE );
    sharingIntent.setType("text/plain");
    String shareBody = "Here is the share content body";
    sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject Here");
    sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);
    startActivity(Intent.createChooser(sharingIntent, "Share via"));

但这里的问题是,当我运行一个应用程序时,它只显示消息屏幕(其中 to blah blah,键入撰写和发送按钮)我不能给我所有这些选项。所以请帮我解决这个...

最佳答案

如果您使用的是模拟器,这是因为消息是唯一安装的可以处理该类型共享的应用程序。您只能分享到已安装的应用程序,即,如果未安装 Twitter 客户端,则无法分享到 Twitter。

关于android - 分享意向不给我一个选择,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11220202/

相关文章:

android - MediaController 导致 java.lang.SecurityException : Permission Denial

java - 如何修复: Resources$NotFoundException while calling Toast

Android:在多个 Activity 中显示菜单

android - 如何从两个 JSON 数组中获取 JSON 对象

android - 在 Oculus GO 触摸板上滑动会触发不应有的 UI 点击

android - "ERROR: OpenGLES initialization failed!"在 CentOS 与 android SDK

Android自定义View(TextView+Button+一些自定义行为)?

android - React Native - 将事件从 Javascript 发送到 Native

android - 创建一个具有多个aar文件作为依赖项的aar

android - 具有多种 View 类型的 CursorRecyclerViewAdapter