QQ的 try { //加人的 String url = "mqqwpa://im/chat?chat_type=wpa&uin=1203415047";//uin是发送过去的qq号码 //添加群的 //String url = "mqqwpa://im/chat?chat_type=group&uin=670943305&version=1"; //uin是发送过去的qq群号码 startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url))); } catch (Exception e) { e.printStackTrace(); }
这是微信的(只能进去微信)
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); startActivity(intent);