本文整理汇总了Java中com.tencent.tauth.IUiListener.onComplete方法的典型用法代码示例。如果您正苦于以下问题:Java IUiListener.onComplete方法的具体用法?Java IUiListener.onComplete怎么用?Java IUiListener.onComplete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.tencent.tauth.IUiListener
的用法示例。
在下文中一共展示了IUiListener.onComplete方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: searchNearby
import com.tencent.tauth.IUiListener; //导入方法依赖的package包/类
public void searchNearby(Activity activity, Bundle bundle, IUiListener iUiListener) {
if (c()) {
this.e = bundle;
this.f = iUiListener;
this.b.post(new Runnable(this) {
final /* synthetic */ LocationApi a;
{
this.a = r1;
}
public void run() {
if (this.a.d.a()) {
Message.obtain(this.a.c, 103).sendToTarget();
} else {
Message.obtain(this.a.c, 104).sendToTarget();
}
}
});
} else if (iUiListener != null) {
iUiListener.onComplete(d());
}
}
示例2: 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);
}
示例3: 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);
}
示例4: 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);
}
示例5: 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 + ""));
}
}
}
}
示例6: 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 + ""));
}
}
}
}