Android 更换applicationId 后 微信没有回调

1、解决办法(代码如下):

使用 <activity-alias>: 这是一个用于定义活动别名的元素。活动别名可以让您为已经定义的活动提供一个别名,从而可以通过别名启动原来的活动。

kotlin 复制代码
       <activity
            android:name=".wxapi.WXEntryActivity"
            android:exported="true"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Translucent.NoTitleBar"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            android:taskAffinity="${applicationId}" />

        <activity-alias
            android:name="${applicationId}.wxapi.WXEntryActivity"
            android:exported="true"
            android:targetActivity=".wxapi.WXEntryActivity" />

        <activity
            android:name=".wxapi.WXPayEntryActivity"
            android:exported="true"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Translucent.NoTitleBar"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            android:taskAffinity="${applicationId}" />

        <activity-alias
            android:name="${applicationId}.wxapi.WXPayEntryActivity"
            android:exported="true"
            android:targetActivity=".wxapi.WXPayEntryActivity" />
            
相关推荐
阿pin3 小时前
Android随笔-kotlin withContext
android·kotlin·withcontext
树码小子4 小时前
开启 IDEA 中的断言功能
android·java·intellij-idea
Android-Flutter5 小时前
android 动画详解
android·kotlin
小孔龙10 小时前
GraphicBuffer 跨进程共享
android
行业研究员11 小时前
Android内置GPS与腾讯地图定位技术对比分析
android·android定位·腾讯地图定位
Android-Flutter11 小时前
android WMS 详解(二)
android·kotlin
游戏开发爱好者812 小时前
App Store 上传 IPA 自动化,.p8 密钥认证与 CI/CD 接入实战
android·运维·ci/cd·小程序·uni-app·自动化·iphone
游戏开发爱好者813 小时前
iOS 推送怎么配置,APNs 推送证书、设备库与群发
android·ios·小程序·https·uni-app·iphone·webview
阿pin14 小时前
Android随笔-kotlin 高阶函数
android·kotlin·高阶函数
wxson72821 天前
【Android视频监控系统技术总结】
android·音视频