当前位置: 首页>>代码示例>>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;未经允许,请勿转载。