import android.content.Intent;
import android.util.Log;
import android.widget.Toast;
import com.i84.cpn.andr.help.ToastHelper;
import com.tencent.mm.opensdk.constants.ConstantsAPI;
import com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram;
import com.tencent.mm.opensdk.openapi.IWXAPIEventHandler;
import cn.sharesdk.wechat.utils.WXAppExtendObject;
import cn.sharesdk.wechat.utils.WXMediaMessage;
import cn.sharesdk.wechat.utils.WechatHandlerActivity;
public class WXEntryActivity extends WechatHandlerActivity implements IWXAPIEventHandler {
public void onGetMessageFromWXReq(WXMediaMessage msg) {
Intent iLaunchMyself = getPackageManager().getLaunchIntentForPackage(getPackageName());
startActivity(iLaunchMyself);
}
public void onShowMessageFromWXReq(WXMediaMessage msg) {
if (msg != null && msg.mediaObject != null
&& (msg.mediaObject instanceof WXAppExtendObject)) {
WXAppExtendObject obj = (WXAppExtendObject) msg.mediaObject;
Toast.makeText(this, obj.extInfo, Toast.LENGTH_SHORT).show();
}
}
@Override
public void onReq(com.tencent.mm.opensdk.modelbase.BaseReq baseReq) {
Log.e("wetch",baseReq.getType() + "");
}
@Override
public void onResp(com.tencent.mm.opensdk.modelbase.BaseResp baseResp) {
if (baseResp.getType() == ConstantsAPI.COMMAND_LAUNCH_WX_MINIPROGRAM) {
WXLaunchMiniProgram.Resp launchMiniProResp = (WXLaunchMiniProgram.Resp) baseResp;
String extraData =launchMiniProResp.extMsg;
ToastHelper.showToast(extraData);
Log.e("wetch",extraData);
}
}
}
是不是跟ShareSDK冲突了
有结果了么?
麻烦在手机微信那里上传下日志: 我->设置->帮助与反馈右上角有个上报日志的入口,麻烦提供一下微信号,时间点