本文整理汇总了Java中com.umeng.socialize.controller.listener.SocializeListeners.SnsPostListener类的典型用法代码示例。如果您正苦于以下问题:Java SnsPostListener类的具体用法?Java SnsPostListener怎么用?Java SnsPostListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SnsPostListener类属于com.umeng.socialize.controller.listener.SocializeListeners包,在下文中一共展示了SnsPostListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dispatchKeyEvent
import com.umeng.socialize.controller.listener.SocializeListeners.SnsPostListener; //导入依赖的package包/类
public boolean dispatchKeyEvent(KeyEvent keyEvent) {
if (!SocializeConstants.BACKKEY_COMPLETE_CLOSE || keyEvent.getKeyCode() != 4) {
return super.dispatchKeyEvent(keyEvent);
}
if (this.r.isShowing()) {
this.r.dismiss();
}
new Handler().postDelayed(new z(this), 400);
SocializeEntity entity = this.v.getEntity();
for (SnsPostListener onComplete : (SnsPostListener[]) this.v.getConfig().getListener
(SnsPostListener.class)) {
onComplete.onComplete(this.x, StatusCode.ST_CODE_ERROR_CANCEL, entity);
}
if (this.v != null) {
this.v.getConfig().cleanListeners();
}
return true;
}
示例2: openShare
import com.umeng.socialize.controller.listener.SocializeListeners.SnsPostListener; //导入依赖的package包/类
public void openShare(Activity activity, SnsPostListener snsPostListener) {
a();
if (e(activity)) {
a(activity);
this.a.addStatisticsData(activity, SHARE_MEDIA.GENERIC, 1);
this.f = null;
b bVar = new b(activity);
bVar.setLayoutParams(new LayoutParams(-1, -1));
this.f = new aj(activity, bVar, UMServiceFactory.getUMSocialService(this.a
.mDescriptor));
this.f.setFocusable(true);
this.f.setBackgroundDrawable(new BitmapDrawable());
this.f.a(this.i);
bVar.a(new n(this));
if (snsPostListener != null) {
this.c.registerListener(snsPostListener);
}
if (this.g) {
d(activity);
} else {
this.f.showAtLocation(activity.getWindow().getDecorView(), 80, 0, 0);
}
}
}
示例3: postShare
import com.umeng.socialize.controller.listener.SocializeListeners.SnsPostListener; //导入依赖的package包/类
public void postShare(Context context, SHARE_MEDIA share_media, SnsPostListener
snsPostListener) {
if (SocializeUtils.platformCheck(context, share_media)) {
if (snsPostListener == null) {
snsPostListener = ListenerUtils.createSnsPostListener();
}
a();
this.a.addStatisticsData(context, share_media, 2);
SocializeConfig.setSelectedPlatfrom(share_media);
b(context.getApplicationContext());
this.c.registerListener(d);
if (share_media.isCustomPlatform()) {
c(context, share_media, snsPostListener);
} else {
a(context, share_media, snsPostListener);
}
}
}
示例4: a
import com.umeng.socialize.controller.listener.SocializeListeners.SnsPostListener; //导入依赖的package包/类
private void a(Context context, SHARE_MEDIA share_media, SnsPostListener snsPostListener) {
Intent intent = new Intent(context, ShareActivity.class);
intent.putExtra(SocializeProtocolConstants.PROTOCOL_KEY_DESCRIPTOR, this.a.mDescriptor);
intent.putExtra("sns", share_media.toString());
if (!OauthHelper.isAuthenticatedAndTokenNotExpired(context, share_media)) {
Dialog createProgressDialog = LoadingDialog.createProgressDialog(context,
share_media, "", false);
UMAuthListener pVar = new p(this, createProgressDialog, context, snsPostListener,
intent);
SocializeUtils.safeShowDialog(createProgressDialog);
this.b.doOauthVerify(context, share_media, pVar);
} else if (this.e) {
String usid = OauthHelper.getUsid(context, share_media);
this.e = false;
postShare(context, usid, share_media, snsPostListener);
} else {
if (this.c.contains(snsPostListener) <= 0) {
this.c.registerListener(snsPostListener);
}
context.startActivity(intent);
}
}
示例5: directShare
import com.umeng.socialize.controller.listener.SocializeListeners.SnsPostListener; //导入依赖的package包/类
public void directShare(Context context, SHARE_MEDIA share_media, SnsPostListener
snsPostListener) {
if (SocializeUtils.platformCheck(context, share_media)) {
if (snsPostListener == null) {
snsPostListener = ListenerUtils.createSnsPostListener();
}
a();
this.a.addStatisticsData(context, share_media, 8);
if (this.a.getShareType() == ShareType.NORMAL) {
SocializeConfig.setSelectedPlatfrom(share_media);
} else {
SocializeConfig.setSelectedPlatfrom(SHARE_MEDIA.GENERIC);
}
b(context.getApplicationContext());
this.c.registerListener(d);
if (share_media.isCustomPlatform()) {
c(context, share_media, snsPostListener);
} else {
b(context, share_media, snsPostListener);
}
}
}
示例6: a
import com.umeng.socialize.controller.listener.SocializeListeners.SnsPostListener; //导入依赖的package包/类
protected void a(MultiStatus multiStatus) {
super.onPostExecute(multiStatus);
SHARE_MEDIA convertToEmun = SHARE_MEDIA.convertToEmun(this.b);
int platformStatus = multiStatus.getPlatformStatus(convertToEmun);
if (platformStatus != 200) {
SocializeUtils.errorHanding(this.d, convertToEmun, Integer.valueOf(platformStatus));
}
if (this.a != null) {
this.a.onComplete(convertToEmun, platformStatus, this.g.a);
}
if (this.g.a.isFireCallback()) {
this.g.c.fireAllListenersOnComplete(SnsPostListener.class, convertToEmun,
platformStatus, this.g.a);
}
m.a(this.g, this.d, (InitializeController) this.g.b);
this.g.c.cleanListeners();
m.d(this.g);
this.g.a.setFireCallback(false);
}
示例7: shareToQQ
import com.umeng.socialize.controller.listener.SocializeListeners.SnsPostListener; //导入依赖的package包/类
public void shareToQQ() {
if (validTencent()) {
this.mSocializeConfig.fireAllListenersOnStart(SnsPostListener.class);
String path = (String) this.mExtraData.get("image_path_local");
if (isLoadImageAsync()) {
loadImage(this.mContext, (String) this.mExtraData.get("image_path_url"));
return;
} else if (isUploadImageAsync(path, this.mShareType)) {
UMImage image = new UMImage(this.mContext, new File(path));
Log.w(TAG, "未安装QQ客户端的情况下,QQ不支持音频,图文是为本地图片的分享。此时将上传本地图片到相册,请确保在QQ互联申请了upload_pic权限" +
".");
authorize(this.mActivity, createUploadAuthListener(image));
return;
} else {
defaultShareToQQ();
return;
}
}
Log.d(TAG, "QQ平台还没有授权");
createAuthListener();
authorize(this.mActivity, this.mAuthListener);
}
示例8: getShareToQZoneListener
import com.umeng.socialize.controller.listener.SocializeListeners.SnsPostListener; //导入依赖的package包/类
private IUiListener getShareToQZoneListener() {
return new IUiListener() {
public void onError(UiError error) {
Log.e("IUiListener", "error code : " + error.errorCode + " error message:"
+ error.errorMessage);
QZoneSsoHandler.this.mSocializeConfig.fireAllListenersOnComplete(SnsPostListener
.class, SHARE_MEDIA.QZONE, StatusCode.ST_CODE_ERROR, UMSsoHandler.mEntity);
}
public void onCancel() {
QZoneSsoHandler.this.mSocializeConfig.fireAllListenersOnComplete(SnsPostListener
.class, SHARE_MEDIA.QZONE, StatusCode.ST_CODE_ERROR_CANCEL, UMSsoHandler
.mEntity);
}
public void onComplete(Object response) {
int code = 200;
if (QZoneSsoHandler.this.getResponseCode(response) != 0) {
code = StatusCode.ST_CODE_ERROR;
}
QZoneSsoHandler.this.mSocializeConfig.fireAllListenersOnComplete(SnsPostListener
.class, SHARE_MEDIA.QZONE, code, UMSsoHandler.mEntity);
QZoneSsoHandler.this.sendReport(true);
}
};
}
示例9: handleOnClick
import com.umeng.socialize.controller.listener.SocializeListeners.SnsPostListener; //导入依赖的package包/类
protected void handleOnClick(CustomPlatform customPlatform, SocializeEntity entity,
SnsPostListener listener) {
if (SocializeConstants.DEFAULTID.equals(this.mAppID)) {
showDialog();
return;
}
this.mSocializeConfig.registerListener(listener);
mEntity = entity;
SocializeConfig.setSelectedPlatfrom(SHARE_MEDIA.QZONE);
if (TextUtils.isEmpty(this.mAppID)) {
this.mAppID = (String) OauthHelper.getAppIdAndAppkey(this.mContext).get("appid");
this.mAppKey = (String) OauthHelper.getAppIdAndAppkey(this.mContext).get("appkey");
}
if (TextUtils.isEmpty(this.mAppID)) {
getAppIdFromServer(new ObtainAppIdListener() {
public void onComplete() {
QZoneSsoHandler.this.shareToQZone();
}
});
} else {
shareToQZone();
}
}
示例10: a
import com.umeng.socialize.controller.listener.SocializeListeners.SnsPostListener; //导入依赖的package包/类
private boolean a(ICallbackListener iCallbackListener, int i) throws SocializeException {
Class cls;
if (iCallbackListener instanceof SnsPostListener) {
cls = SnsPostListener.class;
} else if (iCallbackListener instanceof SocializeClientListener) {
cls = SocializeClientListener.class;
} else if (iCallbackListener instanceof MulStatusListener) {
cls = MulStatusListener.class;
} else if (iCallbackListener instanceof UMAuthListener) {
cls = UMAuthListener.class;
} else {
throw new SocializeException("unknow listener`s class.");
}
if (29 < getListener(cls).length) {
return true;
}
return false;
}
示例11: shareTo
import com.umeng.socialize.controller.listener.SocializeListeners.SnsPostListener; //导入依赖的package包/类
public boolean shareTo() {
int i = 0;
this.isFromAuth = false;
this.mSocializeConfig.fireAllListenersOnStart(SnsPostListener.class);
Req req = new Req();
req.transaction = buildTransaction(this.mShareType);
req.message = this.mWxMediaMessage;
if (this.isWXSceneFavorite) {
req.scene = 2;
} else {
if (this.isToCircle) {
i = 1;
}
req.scene = i;
}
return this.mWXApi.sendReq(req);
}
示例12: sendReport
import com.umeng.socialize.controller.listener.SocializeListeners.SnsPostListener; //导入依赖的package包/类
protected void sendReport(boolean result) {
int statusCode = StatusCode.ST_CODE_ERROR_WEIXIN;
SHARE_MEDIA platform = this.isToCircle ? SHARE_MEDIA.WEIXIN_CIRCLE : SHARE_MEDIA.WEIXIN;
if (result) {
try {
StatisticsDataUtils.addStatisticsData(this.mContext, platform, 17);
} catch (Exception e) {
}
statusCode = 200;
}
if (!haveCallback(this.mContext) || isBlackList(this.mContext)) {
this.mSocializeConfig.fireAllListenersOnComplete(SnsPostListener.class, platform,
statusCode, mEntity);
if (result && mEntity != null) {
SocializeUtils.sendAnalytic(this.mContext, mEntity.mDescriptor, this.mReportDesc,
this.mShareMedia, this.isToCircle ? "wxtimeline" : "wxsession");
}
}
}
示例13: registerCallback
import com.umeng.socialize.controller.listener.SocializeListeners.SnsPostListener; //导入依赖的package包/类
/**
* 设置分享回调
*
* @param
*/
public static void registerCallback(final Context context) {
mController.getConfig().cleanListeners();
mController.getConfig().registerListener(new SnsPostListener() {
@Override
public void onStart() {
}
@Override
public void onComplete(SHARE_MEDIA platform, int stCode,
SocializeEntity entity) {
if (stCode == 200) {
Toast.makeText(context, "分享成功", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(context, "分享失败", Toast.LENGTH_SHORT).show();
}
}
});
}
示例14: shareContent
import com.umeng.socialize.controller.listener.SocializeListeners.SnsPostListener; //导入依赖的package包/类
private void shareContent(SHARE_MEDIA media) {
mController.setShareContent(getShareContent() + getShareUrl());
mController.directShare(getActivity(), media, new SnsPostListener() {
@Override
public void onStart() {
AppContext.showToastShort(R.string.tip_start_share);
}
@Override
public void onComplete(SHARE_MEDIA arg0, int arg1,
SocializeEntity arg2) {
AppContext.showToastShort(R.string.tip_share_done);
}
});
}
示例15: shareToQQ
import com.umeng.socialize.controller.listener.SocializeListeners.SnsPostListener; //导入依赖的package包/类
protected void shareToQQ(SHARE_MEDIA media) {
UMQQSsoHandler qqSsoHandler = new UMQQSsoHandler(getActivity(),
Constants.QQ_APPID, Constants.QQ_APPKEY);
qqSsoHandler.setTargetUrl(getShareUrl());
qqSsoHandler.setTitle(getShareContent());
qqSsoHandler.addToSocialSDK();
mController.setShareContent(getShareContent());
mController.postShare(getActivity(), media, new SnsPostListener() {
@Override
public void onStart() {
AppContext.showToastShort(R.string.tip_start_share);
}
@Override
public void onComplete(SHARE_MEDIA arg0, int arg1,
SocializeEntity arg2) {
AppContext.showToastShort(R.string.tip_share_done);
}
});
}