Android实现QQ跳转到临时聊天界面

直接跳转到某个QQ聊天界面,但是不是发送消息

if (checkApkExist(this, "com.tencent.mobileqq")){  
      startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("mqqwpa://im/chat?chat_type=wpa&uin="+qqNum+"&version=1")));  
}else{  
      Toast.makeText(this,"本机未安装QQ应用",Toast.LENGTH_SHORT).show();  
}

  

检测手机是否安装QQ:

    public boolean checkApkExist(Context context, String packageName) {  
        if (packageName == null || "".equals(packageName))  
        return false;  
        try {  
            ApplicationInfo info = context.getPackageManager().getApplicationInfo(packageName,  
                    PackageManager.GET_UNINSTALLED_PACKAGES);  
            return true;  
        } catch (PackageManager.NameNotFoundException e) {  
            return false;  
        }  
    }

 

转载于:https://www.cnblogs.com/lyxy-lgj/p/6893110.html

你可能感兴趣的:(Android实现QQ跳转到临时聊天界面)