You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

基于Intent的WhatsApp图片分享:生物识别认证引发的问题

问题:开启生物识别锁的WhatsApp无法接收Intent分享的图片

在Android应用中,通过Intent向开启生物识别锁的WhatsApp分享图片时,仅能打开指定聊天窗口,但图片无法加载或发送,无待发送附件显示。该功能1-2周前可正常使用,推测是WhatsApp端发生变更导致。

相关代码

private void openWhatsAppAndTelegram(String packageName, SecureRentTaking_GetterSetter activity, String caption) {
            File appFolderLocation = new File(cachePath, OUTPUT_RENT_RECEIPT_PNG_NAME);
            Uri contentUri = FileProvider.getUriForFile(activity.mContext, BuildConfig.APPLICATION_ID.concat(".provider"), appFolderLocation);

            if (contentUri == null) {
                In_Place.toastHelper.toastErrorMsg("File Not Present");
            } else {
                String toNumber = getFormattedNumber(activity.getTenantContactNumber());//getFormattedWatsAppNumber(activity.getTenantContactNumber());
                toNumber = toNumber.replace("+", "").replace(" ", ""); // E164 format without '+' sign

                Intent sendIntent = new Intent(Intent.ACTION_SEND);
                sendIntent.putExtra(Intent.EXTRA_TEXT, caption);
                sendIntent.putExtra(Intent.EXTRA_STREAM, contentUri);
                sendIntent.setDataAndType(contentUri, activity.mContext.getContentResolver().getType(contentUri));
                sendIntent.putExtra("jid", toNumber + "@s.whatsapp.net"); //phone number without "+" prefix
                sendIntent.setPackage(packageName); //com.whatsapp //com.whatsapp.w4b
                sendIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);

                if (sendIntent.resolveActivity(activity.mContext.getPackageManager()) != null) {
                    activity.mContext.startActivity(Intent.createChooser(sendIntent, "Choose an app"));
                } else {
                    In_Place.toastHelper.toastErrorMsg("App is not Installed");
                    // WhatsApp is not installed, handle accordingly
                    // You can prompt the user to install WhatsApp or use a different method to send messages
                }


            }

        }

现有进展

已发现同类未解决问题:当WhatsApp开启应用锁时,分享内容到WhatsApp失败。

内容的提问来源于stack exchange,提问作者Hitesh Verma

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.18 12:46:06