100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > android 调用第三方QQ 微信 新浪微博 腾讯微博等聊天方法

android 调用第三方QQ 微信 新浪微博 腾讯微博等聊天方法

时间:2023-05-24 23:37:09

相关推荐

android 调用第三方QQ 微信 新浪微博 腾讯微博等聊天方法

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();

}

PS:

新浪微博: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="734473685";(这里写要调用的QQ号)

Stringurl="mqqwpa://im/chat?chat_type=wpa&uin="+qq;

startActivity(newIntent(Intent.ACTION_VIEW,Uri.parse(url)));

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。