本文整理汇总了Java中com.umeng.socialize.controller.listener.SocializeListeners.UMDataListener.onComplete方法的典型用法代码示例。如果您正苦于以下问题:Java UMDataListener.onComplete方法的具体用法?Java UMDataListener.onComplete怎么用?Java UMDataListener.onComplete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.umeng.socialize.controller.listener.SocializeListeners.UMDataListener
的用法示例。
在下文中一共展示了UMDataListener.onComplete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPlatformInfo
import com.umeng.socialize.controller.listener.SocializeListeners.UMDataListener; //导入方法依赖的package包/类
public void getPlatformInfo(Context context, SHARE_MEDIA share_media, UMDataListener
uMDataListener) {
UMDataListener createDataListener;
if (uMDataListener == null) {
createDataListener = ListenerUtils.createDataListener();
} else {
createDataListener = uMDataListener;
}
if (!OauthHelper.isAuthenticated(context, share_media) && share_media != SHARE_MEDIA
.FACEBOOK) {
createDataListener.onStart();
createDataListener.onComplete(StatusCode.ST_CODE_SDK_NO_OAUTH, null);
} else if (share_media == SHARE_MEDIA.WEIXIN || share_media == SHARE_MEDIA.WEIXIN_CIRCLE
|| share_media == SHARE_MEDIA.QQ || share_media == SHARE_MEDIA.FACEBOOK) {
UMSsoHandler ssoHandler = getConfig().getSsoHandler(share_media.getReqCode());
if (ssoHandler == null) {
Log.w("", "请添加" + share_media.toString() + "平台");
} else {
ssoHandler.getUserInfo(createDataListener);
}
} else {
new aa(this, createDataListener, this, context, new SNSPair(share_media.toString(),
OauthHelper.getUsid(context, share_media))).execute();
}
}
示例2: getPlatformKeys
import com.umeng.socialize.controller.listener.SocializeListeners.UMDataListener; //导入方法依赖的package包/类
public void getPlatformKeys(Context context, UMDataListener uMDataListener) {
if (a(context)) {
this.e.getPlatformKeys(context, uMDataListener);
} else {
uMDataListener.onComplete(StatusCode.ST_CODE_SDK_INITQUEUE_FAILED, new HashMap());
}
}
示例3: a
import com.umeng.socialize.controller.listener.SocializeListeners.UMDataListener; //导入方法依赖的package包/类
private void a(Activity activity, SHARE_MEDIA share_media, UMAuthListener uMAuthListener,
UMSsoHandler uMSsoHandler) {
this.a.addStatisticsData(activity, share_media, 12);
UMDataListener aVar = new a(this, activity, share_media, new f(this, uMAuthListener,
activity), uMSsoHandler);
if (this.c == null || this.d == null) {
this.c = SocializeUtils.getPlatformSecret(activity);
this.d = SocializeUtils.getPlatformKey(activity);
}
if (a(share_media)) {
UMSsoHandler ssoHandler = this.b.getSsoHandler(share_media.getReqCode());
String str = "";
Object obj = "";
if (share_media == SHARE_MEDIA.WEIXIN || share_media == SHARE_MEDIA.WEIXIN_CIRCLE) {
str = (String) ssoHandler.mExtraData.get(SocializeConstants.FIELD_WX_APPID);
obj = (String) ssoHandler.mExtraData.get(SocializeConstants.FIELD_WX_SECRET);
this.a.putExtra(SocializeConstants.FIELD_WX_APPID, str);
this.a.putExtra(SocializeConstants.FIELD_WX_SECRET, obj);
} else if (share_media == SHARE_MEDIA.QQ || share_media == SHARE_MEDIA.QZONE) {
str = (String) ssoHandler.mExtraData.get(SocializeConstants.FIELD_QZONE_ID);
String str2 = (String) ssoHandler.mExtraData.get("qzone_secret");
this.a.putExtra(SocializeConstants.FIELD_QZONE_ID, str);
this.a.putExtra("qzone_secret", str2);
}
Object obj2 = null;
if (!(this.d == null || this.d.get(share_media.toString()) == null)) {
obj2 = this.d.get(share_media.toString()).toString();
}
if (!str.equals(obj2)) {
this.d.put(share_media.toString(), str);
this.c.put(share_media.toString(), obj);
SocializeUtils.savePlatformKey(activity, this.d);
SocializeUtils.savePlatformSecret(activity, this.c);
a((Context) activity, this.d, aVar);
return;
}
}
if (b(share_media)) {
aVar.onStart();
aVar.onComplete(200, this.d);
getPlatformKeys(activity, ListenerUtils.createDataListener());
return;
}
getPlatformKeys(activity, aVar);
}
示例4: getUserInfo
import com.umeng.socialize.controller.listener.SocializeListeners.UMDataListener; //导入方法依赖的package包/类
public void getUserInfo(final UMDataListener listener) {
listener.onStart();
if (this.mTencent == null) {
listener.onComplete(StatusCode.ST_CODE_SDK_NO_OAUTH, null);
} else {
new UserInfo(this.mContext, this.mTencent.getQQToken()).getUserInfo(new IUiListener() {
public void onCancel() {
listener.onComplete(StatusCode.ST_CODE_ERROR_CANCEL, null);
}
public void onComplete(Object arg) {
if (arg == null) {
listener.onComplete(StatusCode.ST_CODE_ERROR, null);
return;
}
try {
JSONObject jsonObject = new JSONObject(arg.toString());
Map<String, Object> infos = new HashMap();
infos.put("screen_name", jsonObject.optString(UserTimelineActivity
.NICK_NAME));
infos.put(SocializeProtocolConstants.PROTOCOL_KEY_GENDER, jsonObject
.optString(SocializeProtocolConstants.PROTOCOL_KEY_GENDER));
infos.put(SocializeProtocolConstants.PROTOCOL_KEY_FRIENDS_ICON,
jsonObject.optString("figureurl_qq_2"));
infos.put("is_yellow_year_vip", jsonObject.optString("is_yellow_year_vip"));
infos.put("yellow_vip_level", jsonObject.optString("yellow_vip_level"));
infos.put("msg", jsonObject.optString("msg"));
infos.put("city", jsonObject.optString("city"));
infos.put("vip", jsonObject.optString("vip"));
infos.put("level", jsonObject.optString("level"));
infos.put("province", jsonObject.optString("province"));
infos.put("is_yellow_vip", jsonObject.optString("is_yellow_vip"));
infos.put("openid", OauthHelper.getUsid(UMQQSsoHandler.this.mContext,
SHARE_MEDIA.QQ));
listener.onComplete(200, infos);
} catch (JSONException e) {
listener.onComplete(StatusCode.ST_CODE_ERROR, null);
}
}
public void onError(UiError arg0) {
listener.onComplete(StatusCode.ST_CODE_ERROR, null);
}
});
}
}