欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > 文章正文

android 彩信(图片,视频)分享加载功能,,private bool

来源: javaer 分享于  点击 18604 次 点评:130

android 彩信(图片,视频)分享加载功能,,private bool


private boolean handleSendIntent(Intent intent) {Bundle extras = intent.getExtras();if (extras == null) {return false;}final String mimeType = intent.getType();String action = intent.getAction();if (Intent.ACTION_SEND.equals(action)) {if (extras.containsKey(Intent.EXTRA_STREAM)) {Uri uri = (Uri) extras.getParcelable(Intent.EXTRA_STREAM);               boolean wildcard = "*/*".equals(mimeType);if (mimeType.startsWith("image/") || (wildcard && uri.toString().startsWith(mImageUri))) {setAttachment(1,uri, true);} else if (mimeType.startsWith("video/") || (wildcard && uri.toString().startsWith(mVideoUri))) {setAttachment(2,uri, true);}//addAttachment(mimeType, uri, false);return true;} else if (extras.containsKey(Intent.EXTRA_TEXT)) {MessageText.setText(extras.getString(Intent.EXTRA_TEXT));return true;}Toast.makeText(this, getString(R.string.message_too_big_for_video), Toast.LENGTH_SHORT).show();}//该片段来自于http://byrx.net
相关栏目:

用户点评