Android调用qq聊天、qq、微信等
2015-11-05 09:40
525 查看
1.打开微信
try {
Intent intent = new Intent();
ComponentName cmp = new ComponentName("com.tencent.mm","com.tencent.mm.ui.LauncherUI");
intent.setAction(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setComponent(cmp);
startActivityForResult(intent, 0);
} catch (Exception e) {
Toast.makeText(context, "您的手机未安装微信!", Toast.LENGTH_SHORT).show();
}
另:新浪微博:com.sina.weibo com.sina.weibo.EditActivity
腾讯微博:com.tencent.WBlog com.tencent.WBlog.activity.MicroblogInput
QQ: com.tencent.mobileqq com.tencent.mobileqq.activity.HomeActivity
2.调用QQ聊天
String qq="111111";(这里写要调用的QQ号)
String url="mqqwpa://im/chat?chat_type=wpa&uin="+qq;
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
try {
Intent intent = new Intent();
ComponentName cmp = new ComponentName("com.tencent.mm","com.tencent.mm.ui.LauncherUI");
intent.setAction(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setComponent(cmp);
startActivityForResult(intent, 0);
} catch (Exception e) {
Toast.makeText(context, "您的手机未安装微信!", Toast.LENGTH_SHORT).show();
}
另:新浪微博:com.sina.weibo com.sina.weibo.EditActivity
腾讯微博:com.tencent.WBlog com.tencent.WBlog.activity.MicroblogInput
QQ: com.tencent.mobileqq com.tencent.mobileqq.activity.HomeActivity
2.调用QQ聊天
String qq="111111";(这里写要调用的QQ号)
String url="mqqwpa://im/chat?chat_type=wpa&uin="+qq;
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
相关文章推荐
- 微信公众平台支付接口调用
- js和php判断当前是否为微信浏览器?
- 云龙区院:微信发布涉案财物管理流程
- 另一个国内的 Ngrok 服务器分享
- XMPP框架 微信项目开发之XMPP简介——XMPP的起源,工作原理,使用方法
- 最近做微信遇到的问题
- 将jeecms中微信后台功能和前台认证以及接收消息的功能,修改为插件形式
- 生成二维码,微信分享
- Android仿微信聊天图片缩略图裁剪
- 微信JS-SDK demo使用
- 微信支付提示缺少appid解决办法
- 张小丫第一次微信支付(讲解)
- 仿微信android客户端分享网页内容解决方案
- 微信公众号开发sprintf()函数其中%S等符号的说明
- 微信分享到朋友圈自定义图文
- XMPP框架 微信项目开发之Socket聊天室的建立与登录
- 實戰案例 - 微信平台與自有產品資料對接 (2)
- 关于MVC微信开发遇到的那些坑。
- 微信公众平台生成场景二维码
- 微信支付小结