首页 > 移动平台 > 详细

android Intent.ACTION_SEND

时间:2016-05-21 07:45:54      阅读:252      评论:0      收藏:0      [点我收藏+]

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

原文:http://www.cnblogs.com/lesliefang/p/5513953.html

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