Android app 拉起小程序回调没有执行
//已经在manifest 配置 现在可以正常拉起小程序,但是就是不执行回调,文件添加的路径和包名一致
public class WXEntryActivity extends Activity implements IWXAPIEventHandler {
private IWXAPI api;
@Override
public void onCreate(Bundle savedInstanceState {
super.onCreate(savedInstanceState;
ToastUtiltoast(this, "onCreateWXEntryActivity");
api = WXAPIFactorycreateWXAPI(this, BuildConfig.APPID, false;
try {
Intent intent = getIntent();
api.handleIntent(intent, this;
} catch (Exception e) {
e.printStackTrace();
}
Loge("TAG", "--------onCreate22-");
}
@Override
protected void onNewIntent(Intent intent {
super.onNewIntent(intent;
setIntent(intent;
api.handleIntent(intent, this;
}
@Override
public void onReq(BaseReq baseReq {
ToastUtiltoast(this, "onReqWXEntryActivity");
Loge("TAG---------onReq", " sacvsa" + api.handleIntent(getIntent(), this));
}
@Override
public void onResp(BaseResp resp {
ToastUtiltoast(this, "onRespWXEntryActivity");
Loge("TAG", "--------onResp-" + resp.getType());
if (resp.getType() == ConstantsAPI.COMMAND_LAUNCH_WX_MINIPROGRAM) {
WXLaunchMiniProgram.Resp launchMiniProResp = (WXLaunchMiniProgram.Resp) resp;
String extraData = launchMiniProResp.extMsg; //对应小程序组件 <button open-type="launchApp"> 中的 app-parameter 属性
}
}
}