首页 > 其他 > 详细

19、内容共享

时间:2014-08-22 19:27:09      阅读:285      评论:0      收藏:0      [点我收藏+]

? 将数据发送给其他程序

向其他应用程序发送文本数据

Intent sendIntent = new Intent();

sendIntent.setAction(Intent.ACTION_SEND);

sendIntent.putExtra(Intent.EXTRA_TEXT, "要分享的文本数据");

sendIntent.setType("text/plain");

startActivity(sendIntent); 

? 接收数据

接收文本/图像数据数据 

if (Intent.ACTION_SEND.equals(action) && type != null) {

    if ("text/plain".equals(type)) {

           handleSendText(intent);
    } else if (type.startsWith("image/")) {

          handleSendImage(intent);

    }

? 内容分享 

bubuko.com,布布扣

19、内容共享

原文:http://www.cnblogs.com/androidsj/p/3929953.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!