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


Java IUiListener.onCancel方法代碼示例

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


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

示例1: onActivityResult

import com.tencent.tauth.IUiListener; //導入方法依賴的package包/類
public void onActivityResult(Activity activity, int i, int i2, Intent intent) {
    IUiListener iUiListener;
    for (ApiTask apiTask : this.mTaskList) {
        if (apiTask.mRequestCode == i) {
            IUiListener iUiListener2 = apiTask.mListener;
            this.mTaskList.remove(apiTask);
            iUiListener = iUiListener2;
            break;
        }
    }
    iUiListener = null;
    if (iUiListener == null) {
        f.b(TAG, "BaseApi--onActivityResult-- listener == null");
        AssistActivity.setResultDataForLogin(activity, intent);
        return;
    }
    if (i2 == -1) {
        handleDataToListener(intent, iUiListener);
    } else {
        f.b(f.d, "OpenUi, onActivityResult, Constants.ACTIVITY_CANCEL");
        iUiListener.onCancel();
    }
    f.b();
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:25,代碼來源:BaseApi.java

示例2: onActivityResult

import com.tencent.tauth.IUiListener; //導入方法依賴的package包/類
public void onActivityResult(Activity activity, int i, int i2, Intent intent) {
    IUiListener iUiListener;
    ThreadManager.executeOnSubThread(new Runnable(this) {
        final /* synthetic */ AuthAgent a;

        {
            this.a = r1;
        }

        public void run() {
            Global.saveVersionCode();
        }
    });
    for (ApiTask apiTask : this.mTaskList) {
        if (apiTask.mRequestCode == i) {
            IUiListener iUiListener2 = apiTask.mListener;
            this.mTaskList.remove(apiTask);
            iUiListener = iUiListener2;
            break;
        }
    }
    iUiListener = null;
    if (intent != null) {
        a(intent.getStringExtra(com.tencent.connect.common.Constants.KEY_RESPONSE));
        if (iUiListener == null) {
            AssistActivity.setResultDataForLogin(activity, intent);
            return;
        }
        if (i2 == -1) {
            BaseApi.handleDataToListener(intent, iUiListener);
        } else {
            f.b(f.d, "OpenUi, onActivityResult, Constants.ACTIVITY_CANCEL");
            iUiListener.onCancel();
        }
        releaseResource();
        f.b();
    } else if (iUiListener != null) {
        iUiListener.onCancel();
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:41,代碼來源:AuthAgent.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: onActivityResult

import com.tencent.tauth.IUiListener; //導入方法依賴的package包/類
public void onActivityResult(Activity activity, int i, int i2, Intent intent) {
    IUiListener iUiListener;
    ThreadManager.executeOnSubThread(new Runnable(this) {
        final /* synthetic */ AuthAgent a;

        {
            this.a = r1;
        }

        public void run() {
            Global.saveVersionCode();
        }
    });
    for (ApiTask apiTask : this.mTaskList) {
        if (apiTask.mRequestCode == i) {
            IUiListener iUiListener2 = apiTask.mListener;
            this.mTaskList.remove(apiTask);
            iUiListener = iUiListener2;
            break;
        }
    }
    iUiListener = null;
    if (intent != null) {
        a(intent.getStringExtra(Constants.KEY_RESPONSE));
        if (iUiListener == null) {
            AssistActivity.setResultDataForLogin(activity, intent);
            return;
        }
        if (i2 == -1) {
            BaseApi.handleDataToListener(intent, iUiListener);
        } else {
            f.b(f.d, "OpenUi, onActivityResult, Constants.ACTIVITY_CANCEL");
            iUiListener.onCancel();
        }
        releaseResource();
        f.b();
    } else if (iUiListener != null) {
        iUiListener.onCancel();
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:41,代碼來源:AuthAgent.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.onCancel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。