ACTION_SEND intent 可以把自己的应用添加到系统的发送(分享)列表中。

<intent-filter>
<action android:name="android.intent.action.SEND" /> <data android:mimeType="image/*" /> <category android:name="android.intent.category.DEFAULT" />
</intent-filter>

接收和处理如下:

Intent intent = getIntent();
if (intent.getAction().equals(Intent.ACTION_SEND)) {
Bundle bundle = intent.getExtras();
if (bundle != null) {
Uri uri = (Uri) bundle.get(Intent.EXTRA_STREAM);
if (uri != null) {
try {
bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), uri);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}

android Intent.ACTION_SEND的更多相关文章

  1. android Intent介绍

    Android中提供了Intent机制来协助应用间的交互与通讯,Intent负责对应用中一次操作的动作.动作涉及数据.附加数据进行描述,Android则根据此Intent的描述,负责找到对应的组件,将 ...

  2. android Intent使用

    ntent.setType(“image/*”);//图片格式 intent.setType(“audio/*”); //选择音频 intent.setType(“video/*”); //选择视频 ...

  3. android intent和intent action大全

    1.Intent的用法:(1)用Action跳转1,使用Action跳转,如果有一个程序的AndroidManifest.xml中的某一个 Activity的IntentFilter段中 定义了包含了 ...

  4. Android(Intent 学习)

    Intent 是一个消息传递对象,Intent可以通过多种方式促进组件之间的通信,基本的三种用例: 启动Acitivity: Activity表示应用中的一个屏幕,通过将Intent传递给startA ...

  5. Android Intent的几种用法全面总结

    Android Intent的几种用法全面总结 Intent, 用法 Intent应该算是Android中特有的东西.你可以在Intent中指定程序要执行的动作(比如:view,edit,dial), ...

  6. Android Intent 用法全面总结

    [代码全屏查看]-Android Intent 用法全面总结 // [1].[代码] 调用拨号程序 跳至 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] / ...

  7. 完美实现同时分享图片和文字(Intent.ACTION_SEND)

    private void share(String content, Uri uri){ Intent shareIntent = new Intent(Intent.ACTION_SEND); if ...

  8. Android Intent的几种用法总结【转】

    Intent应该算是Android中特有的东西.你可以在Intent中指定程序要执行的动作(比如:view,edit,dial),以及程序执行到该动作时所需要的资料.都指定好后,只要调用startAc ...

  9. Android Intent的几种使用方法全面总结

    Intent应该算是Android中特有的东西.你能够在Intent中指定程序要运行的动作(比方:view,edit,dial),以及程序运行到该动作时所须要的资料.都指定好后,仅仅要调用startA ...

随机推荐

  1. 随机Loading

    using UnityEngine; using System.Collections; public class Loading : MonoBehaviour { public bool m_Is ...

  2. Unity3D中定时器的使用

    源地址:http://unity3d.9tech.cn/news/2014/0402/40149.html 在游戏设计过程中定时器是必不可少的工具,我们知道update方法是MonoBehavior中 ...

  3. DButils实现查询和新增

             public static Adttendance DBSql(String data) throws SQLException {     String url = "j ...

  4. Python 脚本之获取CPU信息

    #!/usr/bin/env Python from __future__ import print_function from collections import OrderedDict impo ...

  5. CH round #55 Streaming #6

    T^T Saffah大神照样刷我这样诚心诚意想做一套NOIP模拟题的蒟蒻. 第一题 九九归一 好diao的名字... 题意就是给定一队$n,q$,求在模$n$意义下一个数$x$自乘的循环节长度. 当$ ...

  6. Windows环境下的jekyll本地搭建

    一.配置ruby环境 由于jekyll是用ruby语言写的一个静态网页生成工具,所以要搭建jekyll本地环境就需要先配置好ruby环境. 1)去官网下载Ruby:https://www.ruby-l ...

  7. 【Linux】/dev/null 2>&1 详解

     今天一个朋友突然在自己的维护的Linux中, /var/spool/cron/root 中看到了以下的内容: 30 19 * * * /usr/bin/**dcon.sh > /dev/nul ...

  8. Properties类一些常用的用法

    直接上代码: package test.properties; import java.io.File; import java.io.FileInputStream; import java.io. ...

  9. iOS 转载一篇日期处理文章

    感谢原作者的辛勤付出,由于时间太久,记不住原来的地址了,如果你是原作者,请联系我,我会添加原文连接,谢谢! iOS处理时间的类主要包括NSDate,NSDateFormatter, NSDateCom ...

  10. Ubuntu 用户安装 MATE

      MATE 是经典桌面 Gnome 2 的分支,该桌面按照 Windows 用户操作习惯设计,适合于 Windows 转投 Linux 的初级用户,MATE 做了功能改进和新增功能.如:增加窗口管理 ...