您的位置:首页 > 移动开发 > Android开发

android Intent.ACTION_SEND

2016-05-21 07:06 483 查看
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();
}
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: