14
A
回答
40
您可以通过做同样的:
Intent i=new Intent(android.content.Intent.ACTION_SEND);
i.setType("text/plain");
i.putExtra(android.content.Intent.EXTRA_SUBJECT,"Subject test");
i.putExtra(android.content.Intent.EXTRA_TEXT, "extra text that you want to put");
startActivity(Intent.createChooser(i,"Share via"));
详细的例子就是在这里,供大家参考:http://mobile.tutsplus.com/tutorials/android/android-sdk-implement-a-share-intent/
1
共享的内容来源:
Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
//set type
shareIntent.setType("text/plain");
//add what a subject you want
shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,"add what a subject you want");
String shareMessage="message body";
//message
shareIntent.putExtra(android.content.Intent.EXTRA_TEXT,shareMessage);
//start sharing via
startActivity(Intent.createChooser(shareIntent,"Sharing via"));
相关问题
- 1. 如何在android中使用共享首选项来实现身份验证?
- 2. 通过网络实现USB共享
- 3. Android共享首选项
- 4. 共享首选项Android
- 5. Android共享首选项
- 6. 如何使用ShareKit实现通过Twitter,邮件和Tumblr共享
- 7. 如何使用Delphi实现android和ios的共享文本选项
- 8. 如何通过共享android屏幕进行现场演示?
- 9. 如何在Android中重命名现有的共享首选项文件
- 10. Android如何在共享首选项中存储spanned文本
- 11. 如何在Android的共享首选项中使用主键?
- 12. 如何在android中通过twitter共享链接?
- 13. 共享首选项 - 选择铃声基本实现
- 14. Android中访问共享首选项时出现ConcurrentModificationException
- 15. 在Android中实现多选选项RecyclerView
- 16. Symfony2的:实现多个项目共享
- 17. Android:如何通过Android共享意图在Facebook上与CAPTION分享照片?
- 18. 通过导航抽屉上的共享选项共享应用程序
- 19. 如何获取Android中共享首选项的路径?
- 20. 如何共享接口实现
- 21. 共享首选项
- 22. 共享首选项
- 23. 如何通过Android中的WhatsApp共享PDF和文本?
- 24. 如何通过Android中的WhatsApp共享图像+文本+网址?
- 25. Android共享意图Twitter:如何仅通过Tweet或Direct Message共享?
- 26. android共享用户ID用于共享特定的共享首选项值
- 27. Android共享首选项初始化
- 28. Android共享首选项 - 重置
- 29. Android开发共享首选项
- 30. 共享首选项不工作,android?
嗨@Paresh Mayani,嘿嘿好的解决方案,我可以在createChooser对话框中添加更多的自定义选项? – andrewww 2012-11-27 10:38:49