// ComponentName(组件名称)是用来打开其他应用程序中的Activity或服务的Intent intent = new Intent();ComponentName cmp = new ComponentName("com.tencent.mm", "com.tencent.mm.ui.LauncherUI");// 包名该有activityintent.setAction(Intent.ACTION_MAIN);intent.addCategory(Intent.CATEGORY_LAUNCHER);intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);intent.setComponent(cmp);startActivityForResult(intent, 0);//分享图文给好友或者朋友圈---参考http://www.eoeandroid.com/thread-288401-1-1.html?_dsign=23fd2fc1 支持分享多张图片+文字到朋友圈关于同时分享图片+文字的原理可以参考知乎上回答:http://www.zhihu.com/question/21288247
  1. /**
  2.      * 分享图片给好友
  3.      *
  4.      * @param file
  5.      */
  6. private void shareToFriend(File file) {
  7.     Intent intent = new Intent();
  8.     ComponentName comp = new ComponentName("com.tencent.mm", "com.tencent.mm.ui.tools.ShareImgUI");
  9.     intent.setComponent(comp);
  10.     intent.setAction(Intent.ACTION_SEND);
  11.     intent.setType("image/*");
  12.     intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
  13.     startActivity(intent);
  14. }
  15. /**
  16.      * 分享多图到朋友圈,多张图片加文字
  17.      *
  18.      * @param uris
  19.      */
  20. private void shareToTimeLine(String title, ArrayList uris) {
  21.     Intent intent = new Intent();
  22.     ComponentName comp = new ComponentName("com.tencent.mm", "com.tencent.mm.ui.tools.ShareToTimeLineUI");
  23.     intent.setComponent(comp);
  24.     intent.setAction(Intent.ACTION_SEND_MULTIPLE);
  25.     intent.setType("image/*");
  26.     intent.putExtra("Kdescription", title);
  27.     intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
  28.     startActivity(intent);
  29. }

//跳转指定QQ好友或者QQ群聊天界面

//String url="mqqwpa://im/chat?chat_type=wpa&uin=5****1965";//跳转至QQ好友String url = "mqqwpa://im/chat?chat_type=group&uin=463028**3&version=1";//跳转至QQ群startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));

更多相关文章

  1. android 图片转 圆形和圆角矩形
  2. android 图片的缩放,bitmap的用法
  3. android图片资源转换
  4. Android调用摄像头和相册
  5. android 获取视频和图片的缩略图
  6. Android.9图片讲解(二)
  7. Android开发20——单个监听器监听多个按钮点击事件
  8. 初学Android,使用ContentProvider管理多媒体(五十四)
  9. android:text文字添加阴影效果

随机推荐

  1. Android(安卓)imageView图片按比例缩放
  2. Android之提高Service优先级总结及androi
  3. Android(安卓)anr介绍
  4. android studio无法更新之解决方案
  5. android布局及常见布局属性 二
  6. 详解 Android(安卓)的 Activity 组件
  7. Android(安卓)集成FaceBook广告
  8. Android(安卓)的设备节点
  9. Android(安卓)监听短信2种方式:Broadcast
  10. Android中的Selector