当前位置: 首页>>代码示例>>Java>>正文


Java BaseReq类代码示例

本文整理汇总了Java中com.tencent.mm.opensdk.modelbase.BaseReq的典型用法代码示例。如果您正苦于以下问题:Java BaseReq类的具体用法?Java BaseReq怎么用?Java BaseReq使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BaseReq类属于com.tencent.mm.opensdk.modelbase包,在下文中一共展示了BaseReq类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: share

import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void share(@NonNull final ShareData data, @NonNull final OnCallback<String> callback) {

    if (!mApi.isWXAppInstalled()) {
        callback.onFailed(mActivity, ResultCode.RESULT_FAILED, "您未安装微信!");
        return;
    }
    mCallback = callback;
    new AsyncTask<ShareData, Void, BaseReq>() {
        @Override
        protected BaseReq doInBackground(ShareData... params) {
            return makeReq(params[0]);
        }

        @Override
        protected void onPostExecute(BaseReq req) {
            mCallback.onStarted(mActivity);
            mApi.sendReq(req);
        }
    }.execute(data);
}
 
开发者ID:czy1121,项目名称:sdk3rd,代码行数:22,代码来源:WXShare.java

示例2: handleResult

import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void handleResult(Intent data) {
    mIWXAPI.handleIntent(data, new IWXAPIEventHandler() {
        @Override
        public void onReq(BaseReq baseReq) {
        }

        @Override
        public void onResp(BaseResp baseResp) {
            switch (baseResp.errCode) {
                case BaseResp.ErrCode.ERR_OK:
                    ShareUtil.mShareListener.shareSuccess();
                    break;
                case BaseResp.ErrCode.ERR_USER_CANCEL:
                    ShareUtil.mShareListener.shareCancel();
                    break;
                default:
                    ShareUtil.mShareListener.shareFailure(new Exception(baseResp.errStr));
            }
        }
    });
}
 
开发者ID:beanu,项目名称:smart-farmer-android,代码行数:23,代码来源:WxShareInstance.java

示例3: WXHandler

import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
public WXHandler() {
    this.mEventHandler = new IWXAPIEventHandler() {
        public void onResp(BaseResp resp) {
            if(!mLastTransaction.equals(resp.transaction)) {
                return;
            }

            int type = resp.getType();
            switch(type) {
                case ConstantsAPI.COMMAND_SENDAUTH:     //授权返回
                    WXHandler.this.onAuthCallback((SendAuth.Resp)resp);
                    break;

                case ConstantsAPI.COMMAND_SENDMESSAGE_TO_WX:        //分享返回
                    WXHandler.this.onShareCallback((SendMessageToWX.Resp)resp);
                    break;
            }

        }

        public void onReq(BaseReq req) {
        }
    };
}
 
开发者ID:tsy12321,项目名称:SocialSDKAndroid,代码行数:25,代码来源:WXHandler.java

示例4: onReq

import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
    public void onReq(BaseReq req) {
        switch (req.getType()) {
            case ConstantsAPI.COMMAND_GETMESSAGE_FROM_WX:
//                goToGetMsg();
                break;
            case ConstantsAPI.COMMAND_SHOWMESSAGE_FROM_WX:
//                goToShowMsg((ShowMessageFromWX.Req) req);
                break;
            default:
                break;
        }
        Toast.makeText(this, req.openId, Toast.LENGTH_LONG).show();

    }
 
开发者ID:mangestudio,项目名称:GCSApp,代码行数:16,代码来源:WXEntryActivity.java

示例5: run

import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void run() {
    if (mAction.getPayType() == Pay.PayType.APIPAY) {
        PayTask payTask = new PayTask(mPay.getContext());
        String mapToParameters = Utils.getMapToParameters(mPayInfo.getOrderInfo(Map.class));
        Map<String, String> result = payTask.payV2(mapToParameters, false);
        PayResult payResult = new PayResult(result);
        if (TextUtils.equals(payResult.getResultStatus(), "9000")) {
            mDispatcher.dispatchResult(Dispatcher.SUCCESS, this);
        } else {
            mDispatcher.dispatchResult(Dispatcher.FAILED, this);
        }
    } else if (mAction.getPayType() == Pay.PayType.WECHAT) {
        PayReq payReq = mPayInfo.getOrderInfo(PayReq.class);
        IWXAPI msgApi = WXAPIFactory.createWXAPI(mPay.getContext(), null);
        msgApi.registerApp(payReq.appId);
        msgApi.handleIntent(mPay.getContext().getIntent(), new IWXAPIEventHandler() {
            @Override
            public void onReq(BaseReq baseReq) {

            }

            @Override
            public void onResp(BaseResp baseResp) {

            }
        });
    }
}
 
开发者ID:egzosn,项目名称:pay-java-android,代码行数:30,代码来源:PayHunter.java

示例6: handleResult

import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void handleResult(int requestCode, int resultCode, Intent data) {
    mIWXAPI.handleIntent(data, new IWXAPIEventHandler() {
        @Override
        public void onReq(BaseReq baseReq) {
        }

        @Override
        public void onResp(BaseResp baseResp) {
            if (baseResp instanceof SendAuth.Resp && baseResp.getType() == 1) {
                SendAuth.Resp resp = (SendAuth.Resp) baseResp;
                switch (resp.errCode) {
                    case BaseResp.ErrCode.ERR_OK:
                        getToken(resp.code);
                        break;
                    case BaseResp.ErrCode.ERR_USER_CANCEL:
                        mLoginListener.loginCancel();
                        break;
                    case BaseResp.ErrCode.ERR_SENT_FAILED:
                        mLoginListener.loginFailure(new Exception(INFO.WX_ERR_SENT_FAILED));
                        break;
                    case BaseResp.ErrCode.ERR_UNSUPPORT:
                        mLoginListener.loginFailure(new Exception(INFO.WX_ERR_UNSUPPORT));
                        break;
                    case BaseResp.ErrCode.ERR_AUTH_DENIED:
                        mLoginListener.loginFailure(new Exception(INFO.WX_ERR_AUTH_DENIED));
                        break;
                    default:
                        mLoginListener.loginFailure(new Exception(INFO.WX_ERR_AUTH_ERROR));
                }
            }
        }
    });
}
 
开发者ID:beanu,项目名称:smart-farmer-android,代码行数:35,代码来源:WxLoginInstance.java

示例7: onReq

import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
public void onReq(BaseReq req) {
    if(this.mWXHandler != null) {
        this.mWXHandler.getWXEventHandler().onReq(req);
    }

    this.finish();
}
 
开发者ID:tsy12321,项目名称:SocialSDKAndroid,代码行数:8,代码来源:WXCallbackActivity.java

示例8: onReq

import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void onReq(BaseReq baseReq) {
    Log.d(TAG, "onReq");
    if (isAutoFinishAfterOnReq()) {
        finish();
    }
}
 
开发者ID:Bilibili,项目名称:BiliShare,代码行数:8,代码来源:BaseWXEntryActivity.java

示例9: onReq

import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void onReq(BaseReq req) {
    Log.e(TAG, "transaction = " + req.transaction + ", type = " + req.getType() + ", openId = " + req.openId);
}
 
开发者ID:czy1121,项目名称:sdk3rd,代码行数:5,代码来源:WXBase.java

示例10: onReq

import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void onReq(BaseReq baseReq) {
}
 
开发者ID:penghuanliang,项目名称:Rxjava2.0Demo,代码行数:4,代码来源:WXEntryActivity.java

示例11: onReq

import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void onReq(BaseReq req) {
}
 
开发者ID:snowwolf10285,项目名称:PicShow-zhaipin,代码行数:4,代码来源:WXPayEntryActivity.java

示例12: onReq

import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void onReq(BaseReq baseReq) {
    // 发起微信请求将会经过的方法
    LogUtils.e(TAG, "onReq: " + baseReq.toString());
}
 
开发者ID:chendongMarch,项目名称:SocialSdkLibrary,代码行数:6,代码来源:ActionActivity.java

示例13: onReq

import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void onReq(BaseReq req) {
    finish();
}
 
开发者ID:natjs,项目名称:nat-wechat,代码行数:5,代码来源:EntryActivity.java

示例14: onReq

import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void onReq(BaseReq req) {
    LogUtil.e("微信:onReq");
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:5,代码来源:WXPayEntryActivity.java

示例15: onReq

import com.tencent.mm.opensdk.modelbase.BaseReq; //导入依赖的package包/类
@Override
public void onReq(BaseReq baseReq) {
    // no-op
}
 
开发者ID:ChaosLeong,项目名称:FxcnBeta,代码行数:5,代码来源:WXEntryActivity.java


注:本文中的com.tencent.mm.opensdk.modelbase.BaseReq类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。