Android跳转QQ与分享

一、打开应用

//打开微信

Intent intent = getPackageManager().getLaunchIntentForPackage("com.tencent.mm");  
startActivity(intent);    

com.tencent.mm为微信的包名,填什么应用的包名则打开那个应用


二、跳转到QQ窗口聊天

String url="mqqwpa://im/chat?chat_type=wpa&uin=741047261";
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));

uin为你要跳转的聊天窗口的QQ号


三 、web跳转QQ聊天

<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=741047261&site=qq&menu=yes">点击咨询客服</a>


四、跳转QQ群

String url = "mqqapi://card/show_pslcard?src_type=internal&version=群号&card_type=group&source=qrcode";
startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse(url)));


五、软件分享

Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
Toast.makeText(getApplicationContext(), "好东西分享", Toast.LENGTH_LONG).show();
intent.putExtra(Intent.EXTRA_TEXT, "分享的内容(大家好,我是派大星)");
startActivity(Intent.createChooser(intent, "分享到"));

猜你喜欢

转载自blog.csdn.net/junmoxi/article/details/79827538