集成微信 SDK 實現分享功能,`onResp` 回調未被觸發,Toast 提示「分享成功」不顯示。
// Manifest 關鍵配置
<activity
android:name=".wxapi.WXEntryActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
// Activity 關鍵代碼
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
api.handleIntent(intent, this); // 必須
}
在 `onResp` 首行打印 Log,觀察是否進入;若不進入,基本可鎖定為包名/簽名/Manifest 配置問題。
Android 微信分享無回調,WXEntryActivity 配置,包名簽名一致性,handleIntent 處理,ProGuard 保留規則。