當前位置: 首頁>>代碼示例>>Java>>正文


Java IUiListener.onError方法代碼示例

本文整理匯總了Java中com.tencent.tauth.IUiListener.onError方法的典型用法代碼示例。如果您正苦於以下問題:Java IUiListener.onError方法的具體用法?Java IUiListener.onError怎麽用?Java IUiListener.onError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.tencent.tauth.IUiListener的用法示例。


在下文中一共展示了IUiListener.onError方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: openBrowser

import com.tencent.tauth.IUiListener; //導入方法依賴的package包/類
private void openBrowser(Bundle bundle) {
    String string = bundle.getString("viaShareType");
    String string2 = bundle.getString("callbackAction");
    String string3 = bundle.getString("url");
    String string4 = bundle.getString("openId");
    String string5 = bundle.getString("appId");
    String str = "";
    String str2 = "";
    if (SystemUtils.QQ_SHARE_CALLBACK_ACTION.equals(string2)) {
        str = Constants.VIA_SHARE_TO_QQ;
        str2 = "10";
    } else if (SystemUtils.QZONE_SHARE_CALLBACK_ACTION.equals(string2)) {
        str = Constants.VIA_SHARE_TO_QZONE;
        str2 = "11";
    }
    if (Util.openBrowser(this, string3)) {
        d.a().a(string4, string5, str, str2, "3", "0", string, "0", "2", "0");
    } else {
        IUiListener iUiListener = (IUiListener) TemporaryStorage.get(string2);
        if (iUiListener != null) {
            iUiListener.onError(new UiError(-6, Constants.MSG_OPEN_BROWSER_ERROR, null));
        }
        d.a().a(string4, string5, str, str2, "3", "1", string, "0", "2", "0");
        finish();
    }
    getIntent().removeExtra("shareH5");
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:28,代碼來源:AssistActivity.java

示例2: getWPAUserOnlineState

import com.tencent.tauth.IUiListener; //導入方法依賴的package包/類
public void getWPAUserOnlineState(String str, IUiListener iUiListener) {
    if (str == null) {
        try {
            d.a().a(this.mToken.getOpenId(), this.mToken.getAppId(), Constants.VIA_WAP_STATE, "15", "18", "1");
            throw new Exception("uin null");
        } catch (Exception e) {
            if (iUiListener != null) {
                iUiListener.onError(new UiError(-5, Constants.MSG_PARAM_ERROR, null));
            }
            d.a().a(this.mToken.getOpenId(), this.mToken.getAppId(), Constants.VIA_WAP_STATE, "15", "18", "1");
        }
    } else if (str.length() < 5) {
        d.a().a(this.mToken.getOpenId(), this.mToken.getAppId(), Constants.VIA_WAP_STATE, "15", "18", "1");
        throw new Exception("uin length < 5");
    } else {
        int i = 0;
        while (i < str.length()) {
            if (Character.isDigit(str.charAt(i))) {
                i++;
            } else {
                d.a().a(this.mToken.getOpenId(), this.mToken.getAppId(), Constants.VIA_WAP_STATE, "15", "18", "1");
                throw new Exception("uin not digit");
            }
        }
        Bundle bundle = null;
        HttpUtils.requestAsync(this.mToken, Global.getContext(), "http://webpresence.qq.com/getonline?Type=1&" + str + NetworkUtils.DELIMITER_COLON, bundle, "GET", new TempRequestListener(iUiListener));
        d.a().a(this.mToken.getOpenId(), this.mToken.getAppId(), Constants.VIA_WAP_STATE, "15", "18", "0");
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:30,代碼來源:WPA.java

示例3: deleteRecord

import com.tencent.tauth.IUiListener; //導入方法依賴的package包/類
public void deleteRecord(String str, final IUiListener iUiListener) {
    Bundle composeCGIParams = composeCGIParams();
    IRequestListener tempRequestListener = new TempRequestListener(new IUiListener(this) {
        final /* synthetic */ RecordManager b;

        public void onError(UiError uiError) {
            iUiListener.onError(uiError);
        }

        public void onComplete(Object obj) {
            JSONObject jSONObject = (JSONObject) obj;
            try {
                if (jSONObject.getInt("ret") == 0) {
                    iUiListener.onComplete("");
                } else {
                    iUiListener.onError(new UiError(-4, jSONObject.toString(), null));
                }
            } catch (JSONException e) {
                iUiListener.onError(new UiError(-4, e.getMessage(), null));
            }
        }

        public void onCancel() {
            iUiListener.onCancel();
        }
    });
    composeCGIParams.putString("key", Util.toHexString(str));
    HttpUtils.requestAsync(this.mToken, Global.getContext(), "https://graph.qq.com/weiyun/delete_record", composeCGIParams, "GET", tempRequestListener);
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:30,代碼來源:RecordManager.java

示例4: getRecord

import com.tencent.tauth.IUiListener; //導入方法依賴的package包/類
public void getRecord(String str, final IUiListener iUiListener) {
    Bundle composeCGIParams = composeCGIParams();
    IRequestListener tempRequestListener = new TempRequestListener(new IUiListener(this) {
        final /* synthetic */ RecordManager b;

        public void onError(UiError uiError) {
            iUiListener.onError(uiError);
        }

        public void onComplete(Object obj) {
            JSONObject jSONObject = (JSONObject) obj;
            try {
                if (jSONObject.getInt("ret") == 0) {
                    iUiListener.onComplete(Util.hexToString(jSONObject.getJSONObject(ShareRequestParam.RESP_UPLOAD_PIC_PARAM_DATA).getString(Constants.VALUE_ID)));
                    return;
                }
                iUiListener.onError(new UiError(-4, jSONObject.toString(), null));
            } catch (JSONException e) {
                iUiListener.onError(new UiError(-4, e.getMessage(), null));
            }
        }

        public void onCancel() {
            iUiListener.onCancel();
        }
    });
    composeCGIParams.putString("key", Util.toHexString(str));
    HttpUtils.requestAsync(this.mToken, Global.getContext(), "https://graph.qq.com/weiyun/get_record", composeCGIParams, "GET", tempRequestListener);
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:30,代碼來源:RecordManager.java

示例5: checkRecord

import com.tencent.tauth.IUiListener; //導入方法依賴的package包/類
public void checkRecord(String str, final IUiListener iUiListener) {
    Bundle composeCGIParams = composeCGIParams();
    IRequestListener tempRequestListener = new TempRequestListener(new IUiListener(this) {
        final /* synthetic */ RecordManager b;

        public void onError(UiError uiError) {
            iUiListener.onError(uiError);
        }

        public void onComplete(Object obj) {
            try {
                if (((JSONObject) obj).getInt("ret") == 0) {
                    iUiListener.onComplete(Boolean.TRUE);
                } else {
                    iUiListener.onComplete(Boolean.FALSE);
                }
            } catch (JSONException e) {
                iUiListener.onError(new UiError(-4, e.getMessage(), null));
            }
        }

        public void onCancel() {
            iUiListener.onCancel();
        }
    });
    composeCGIParams.putString("key", Util.toHexString(str));
    HttpUtils.requestAsync(this.mToken, Global.getContext(), "https://graph.qq.com/weiyun/check_record", composeCGIParams, "GET", tempRequestListener);
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:29,代碼來源:RecordManager.java

示例6: openBrowser

import com.tencent.tauth.IUiListener; //導入方法依賴的package包/類
private void openBrowser(Bundle bundle) {
    String string = bundle.getString("viaShareType");
    String string2 = bundle.getString("callbackAction");
    String string3 = bundle.getString("url");
    String string4 = bundle.getString("openId");
    String string5 = bundle.getString("appId");
    String str = "";
    String str2 = "";
    if (SystemUtils.QQ_SHARE_CALLBACK_ACTION.equals(string2)) {
        str = Constants.VIA_SHARE_TO_QQ;
        str2 = Constants.VIA_REPORT_TYPE_SHARE_TO_QQ;
    } else if (SystemUtils.QZONE_SHARE_CALLBACK_ACTION.equals(string2)) {
        str = Constants.VIA_SHARE_TO_QZONE;
        str2 = Constants.VIA_REPORT_TYPE_SHARE_TO_QZONE;
    }
    if (Util.openBrowser(this, string3)) {
        d.a().a(string4, string5, str, str2, "3", "0", string, "0", "2", "0");
    } else {
        IUiListener iUiListener = (IUiListener) TemporaryStorage.get(string2);
        if (iUiListener != null) {
            iUiListener.onError(new UiError(-6, Constants.MSG_OPEN_BROWSER_ERROR, null));
        }
        d.a().a(string4, string5, str, str2, "3", "1", string, "0", "2", "0");
        finish();
    }
    getIntent().removeExtra("shareH5");
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:28,代碼來源:AssistActivity.java

示例7: handleDataToListener

import com.tencent.tauth.IUiListener; //導入方法依賴的package包/類
public static void handleDataToListener(Intent intent, IUiListener iUiListener) {
    if (intent == null) {
        iUiListener.onCancel();
        return;
    }
    String stringExtra = intent.getStringExtra(Constants.KEY_ACTION);
    String stringExtra2;
    if (SystemUtils.ACTION_LOGIN.equals(stringExtra)) {
        int intExtra = intent.getIntExtra(Constants.KEY_ERROR_CODE, 0);
        if (intExtra == 0) {
            stringExtra2 = intent.getStringExtra(Constants.KEY_RESPONSE);
            if (stringExtra2 != null) {
                try {
                    iUiListener.onComplete(Util.parseJson(stringExtra2));
                    return;
                } catch (Throwable e) {
                    iUiListener.onError(new UiError(-4, Constants.MSG_JSON_ERROR, stringExtra2));
                    f.b(f.d, "OpenUi, onActivityResult, json error", e);
                    return;
                }
            }
            f.b(f.d, "OpenUi, onActivityResult, onComplete");
            iUiListener.onComplete(new JSONObject());
            return;
        }
        f.e(f.d, "OpenUi, onActivityResult, onError = " + intExtra + "");
        iUiListener.onError(new UiError(intExtra, intent.getStringExtra(Constants.KEY_ERROR_MSG), intent.getStringExtra(Constants.KEY_ERROR_DETAIL)));
    } else if (SystemUtils.ACTION_SHARE.equals(stringExtra)) {
        stringExtra = intent.getStringExtra("result");
        stringExtra2 = intent.getStringExtra("response");
        if ("cancel".equals(stringExtra)) {
            iUiListener.onCancel();
        } else if (NativeProtocol.BRIDGE_ARG_ERROR_BUNDLE.equals(stringExtra)) {
            iUiListener.onError(new UiError(-6, "unknown error", stringExtra2 + ""));
        } else if ("complete".equals(stringExtra)) {
            try {
                if (stringExtra2 == null) {
                    stringExtra = "{\"ret\": 0}";
                } else {
                    stringExtra = stringExtra2;
                }
                iUiListener.onComplete(new JSONObject(stringExtra));
            } catch (JSONException e2) {
                e2.printStackTrace();
                iUiListener.onError(new UiError(-4, "json error", stringExtra2 + ""));
            }
        }
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:50,代碼來源:BaseApi.java

示例8: handleDataToListener

import com.tencent.tauth.IUiListener; //導入方法依賴的package包/類
public static void handleDataToListener(Intent intent, IUiListener iUiListener) {
    String stringExtra;
    if (intent == null) {
        iUiListener.onCancel();
        return;
    }
    String stringExtra2 = intent.getStringExtra(Constants.KEY_ACTION);
    if (SystemUtils.ACTION_LOGIN.equals(stringExtra2)) {
        int intExtra = intent.getIntExtra(Constants.KEY_ERROR_CODE, 0);
        if (intExtra == 0) {
            stringExtra = intent.getStringExtra(Constants.KEY_RESPONSE);
            if (stringExtra != null) {
                try {
                    iUiListener.onComplete(Util.parseJson(stringExtra));
                    return;
                } catch (Throwable e) {
                    iUiListener.onError(new UiError(-4, Constants.MSG_JSON_ERROR, stringExtra));
                    f.b(f.d, "OpenUi, onActivityResult, json error", e);
                    return;
                }
            }
            f.b(f.d, "OpenUi, onActivityResult, onComplete");
            iUiListener.onComplete(new JSONObject());
            return;
        }
        f.e(f.d, "OpenUi, onActivityResult, onError = " + intExtra + "");
        iUiListener.onError(new UiError(intExtra, intent.getStringExtra(Constants
                .KEY_ERROR_MSG), intent.getStringExtra(Constants.KEY_ERROR_DETAIL)));
    } else if (SystemUtils.ACTION_SHARE.equals(stringExtra2)) {
        stringExtra2 = intent.getStringExtra("result");
        stringExtra = intent.getStringExtra("response");
        if ("cancel".equals(stringExtra2)) {
            iUiListener.onCancel();
        } else if ("error".equals(stringExtra2)) {
            iUiListener.onError(new UiError(-6, "unknown error", stringExtra + ""));
        } else if ("complete".equals(stringExtra2)) {
            try {
                if (stringExtra == null) {
                    stringExtra2 = "{\"ret\": 0}";
                } else {
                    stringExtra2 = stringExtra;
                }
                iUiListener.onComplete(new JSONObject(stringExtra2));
            } catch (JSONException e2) {
                e2.printStackTrace();
                iUiListener.onError(new UiError(-4, "json error", stringExtra + ""));
            }
        }
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:51,代碼來源:BaseApi.java


注:本文中的com.tencent.tauth.IUiListener.onError方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。