com.tencent.connect.share.QQShare Java Examples
The following examples show how to use
com.tencent.connect.share.QQShare.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: QQShareInstance.java From ShareLoginPayUtil with Apache License 2.0 | 6 votes |
private void shareToQQForImage(String localUrl, Activity activity, ShareListener listener) { if (mTencent == null) { listener.shareFailure(new Exception("分享失败")); recycle(); activity.finish(); return; } if (listener != null) { listener.shareStart(); } Bundle params = new Bundle(); params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_IMAGE); params.putString(QQShare.SHARE_TO_QQ_IMAGE_LOCAL_URL, localUrl); mTencent.shareToQQ(activity, params, listener); recycle(); }
Example #2
Source File: QQHelper.java From android-common-utils with Apache License 2.0 | 6 votes |
/** * 分享, * <li>jumpUrl , title , summary 不能同时为空 </li> * @param jumpUrl 消息被点击时跳转的url * @param title 分享标题 * @param summary 分享消息摘要 */ public void share(Activity activity,String appName,String jumpUrl,String title,String summary, String imageUrl,IQQCallback callbak){ this.mShareCallback = callbak; Bundle bundle = new Bundle(); //这条分享消息被好友点击后的跳转URL。 bundle.putString(QQShare.SHARE_TO_QQ_TARGET_URL, jumpUrl); //分享的标题。注:PARAM_TITLE、PARAM_IMAGE_URL、PARAM_SUMMARY不能全为空,最少必须有一个是有值的。 bundle.putString(QQShare.SHARE_TO_QQ_TITLE, title); //分享的图片URL bundle.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, imageUrl); //分享的消息摘要,最长50个字 bundle.putString(QQShare.SHARE_TO_QQ_SUMMARY, summary); bundle.putString(QQShare.SHARE_TO_QQ_APP_NAME, appName); //声音分享 /* if (shareType == QQShare.SHARE_TO_QQ_TYPE_AUDIO) { params.putString(QQShare.SHARE_TO_QQ_AUDIO_URL, mEditTextAudioUrl.getText().toString()); }*/ bundle.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_DEFAULT); // showToast("在好友选择列表会自动打开分享到qzone的弹窗~~~"); // bundle.putInt(QQShare.SHARE_TO_QQ_EXT_INT, QQShare.SHARE_TO_QQ_FLAG_QZONE_AUTO_OPEN); mTencent.shareToQQ(activity, bundle , mShareListener); }
Example #3
Source File: ShareModel.java From Android-Application-ZJB with Apache License 2.0 | 6 votes |
private void shareWeb2QQ(WXEntryActivity activity, ShareBean bean, int type) { // extarFlag ==1 会弹出发送到QQ控件的对话框,为0则不会弹出 int extarFlag = 0; //2.确定分享类型 int shareType = type == IShareProvider.SHARE_CONTENT_TYPE_IMAGE ? QQShare.SHARE_TO_QQ_TYPE_IMAGE : QQShare.SHARE_TO_QQ_TYPE_DEFAULT; //3.构建分享的参数 final Bundle params = new Bundle(); if (shareType != QQShare.SHARE_TO_QQ_TYPE_IMAGE) { if (!TextUtils.isEmpty(bean.getTitle())) { params.putString(QQShare.SHARE_TO_QQ_TITLE, bean.getTitle()); } String targetUrl = bean.getTargetUrl(); if (!TextUtils.isEmpty(targetUrl)) { params.putString(QQShare.SHARE_TO_QQ_TARGET_URL, UrlParserManager.getInstance().parsePlaceholderUrl(targetUrl)); } if (!TextUtils.isEmpty(bean.getSummary())) { params.putString(QQShare.SHARE_TO_QQ_SUMMARY, bean.getSummary()); } } params.putString(QQShare.SHARE_TO_QQ_APP_NAME, ResHelper.getString(R.string.app_name)); params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, shareType); params.putInt(QQShare.SHARE_TO_QQ_EXT_INT, extarFlag); mTencent.shareToQQ(activity, params, activity); }
Example #4
Source File: QQChatShareHandler.java From BiliShare with Apache License 2.0 | 6 votes |
/** * 纯图模式,localPath不能为空 * * @param params * @param image */ private void shareImage(BaseShareParam params, final ShareImage image) throws ShareException { mImageHelper.downloadImageIfNeed(image, new Runnable() { @Override public void run() { Log.d(TAG, "share image"); final Bundle bundle = new Bundle(); bundle.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_IMAGE); if (image.isLocalImage()) { bundle.putString(QQShare.SHARE_TO_QQ_IMAGE_LOCAL_URL, image.getLocalPath()); } doShareToQQ((Activity) getContext(), bundle); } }); }
Example #5
Source File: QQChatShareHandler.java From BiliShare with Apache License 2.0 | 6 votes |
/** * 图文模式,title、targetURL不能为空 * * @param params * @param image * @throws ShareException */ private void shareImageText(BaseShareParam params, ShareImage image) throws ShareException { if (TextUtils.isEmpty(params.getTitle()) || TextUtils.isEmpty(params.getTargetUrl())) { throw new InvalidParamException("Title or target url is empty or illegal"); } Log.d(TAG, "share image text"); final Bundle bundle = new Bundle(); bundle.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_DEFAULT); bundle.putString(QQShare.SHARE_TO_QQ_TITLE, params.getTitle()); bundle.putString(QQShare.SHARE_TO_QQ_SUMMARY, params.getContent()); bundle.putString(QQShare.SHARE_TO_QQ_TARGET_URL, params.getTargetUrl()); if (image != null) { if (image.isNetImage()) { bundle.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, image.getNetImageUrl()); } else if (image.isLocalImage()) { bundle.putString(QQShare.SHARE_TO_QQ_IMAGE_LOCAL_URL, image.getLocalPath()); } } doShareToQQ((Activity) getContext(), bundle); }
Example #6
Source File: QQPlatform.java From SocialSdkLibrary with Apache License 2.0 | 6 votes |
private Bundle buildCommonBundle(String title, String summary, String targetUrl, int shareTarget) { final Bundle params = new Bundle(); if (!TextUtils.isEmpty(title)) params.putString(QQShare.SHARE_TO_QQ_TITLE, title); if (!TextUtils.isEmpty(summary)) params.putString(QQShare.SHARE_TO_QQ_SUMMARY, summary); if (!TextUtils.isEmpty(targetUrl)) params.putString(QQShare.SHARE_TO_QQ_TARGET_URL, targetUrl); if (!TextUtils.isEmpty(mAppName)) params.putString(QQShare.SHARE_TO_QQ_APP_NAME, mAppName); // 加了这个会自动打开qq空间发布 if (shareTarget == Target.SHARE_QQ_ZONE) params.putInt(QQShare.SHARE_TO_QQ_EXT_INT, QQShare.SHARE_TO_QQ_FLAG_QZONE_AUTO_OPEN); params.putString(QQShare.SHARE_TO_QQ_ARK_INFO, "ask return key"); return params; }
Example #7
Source File: AbstractShare.java From LoginSharePay with Apache License 2.0 | 6 votes |
@Override public void launchQQShare(QQMessageBody qqMessageBody) { super.launchQQShare(qqMessageBody); Bundle bundle = new Bundle(); if (qqMessageBody.type == QQMessageBody.QQChat) { bundle.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_DEFAULT); bundle.putString(QQShare.SHARE_TO_QQ_TITLE, qqMessageBody.getTitle()); bundle.putString(QQShare.SHARE_TO_QQ_SUMMARY, qqMessageBody.getSummary()); bundle.putString(QQShare.SHARE_TO_QQ_TARGET_URL, qqMessageBody.getTargetUrl()); bundle.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, qqMessageBody.getImageUrl()); bundle.putString(QQShare.SHARE_TO_QQ_APP_NAME, appInfo.loadLabel(packageManager).toString()); tencent.shareToQQ(activity, bundle, this); } else { bundle.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE, QzoneShare.SHARE_TO_QZONE_TYPE_IMAGE_TEXT); bundle.putString(QzoneShare.SHARE_TO_QQ_TITLE, qqMessageBody.getTitle());//必填 bundle.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, qqMessageBody.getSummary());//选填 bundle.putString(QzoneShare.SHARE_TO_QQ_TARGET_URL, qqMessageBody.getTargetUrl());//必填 bundle.putStringArrayList(QzoneShare.SHARE_TO_QQ_IMAGE_URL, qqMessageBody.getImagesUtl()); tencent.shareToQzone(activity, bundle, this); } }
Example #8
Source File: QQShareApi.java From browser with GNU General Public License v2.0 | 6 votes |
public static void shareAppQQ(final Activity activity,IUiListener listener) { if (api == null) { api = Tencent.createInstance(APP_ID, MainApp.getContext()); } if(api==null){ return; } final Bundle params = new Bundle(); params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_APP); params.putString(QQShare.SHARE_TO_QQ_TITLE, "优分享"); params.putString(QQShare.SHARE_TO_QQ_SUMMARY, "优分享是一个内嵌移动浏览器的网页图片社交分享软件。\n" + "优分享可以向你的朋友家人收发文字,语音,动态图片,视频等信息。"); params.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, "http://youkes.oss.aliyuncs.com/icon/icon_96.png"); params.putString(QQShare.SHARE_TO_QQ_APP_NAME, "优分享"); api.shareToQQ(activity, params, listener); }
Example #9
Source File: QQShareApi.java From browser with GNU General Public License v2.0 | 6 votes |
public static void shareWebPageQQFriend(final Activity activity,final String url,final String title,final String desc,final String img,IUiListener listener ){ if (api == null) { api = Tencent.createInstance(APP_ID, MainApp.getContext()); } if(api==null){ return; } final Bundle params = new Bundle(); params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_DEFAULT); params.putString(QQShare.SHARE_TO_QQ_TITLE, title); params.putString(QQShare.SHARE_TO_QQ_SUMMARY, desc); params.putString(QQShare.SHARE_TO_QQ_TARGET_URL, url); String postimg=img; if(StringUtils.isEmpty(img)) { postimg="http://youkes.oss.aliyuncs.com/icon/icon_96.png"; } params.putString(QQShare.SHARE_TO_QQ_IMAGE_URL,postimg); params.putString(QQShare.SHARE_TO_QQ_APP_NAME, "优分享"); api.shareToQQ(activity, params,listener); }
Example #10
Source File: QQShareInstance.java From ShareLoginPayUtil with Apache License 2.0 | 6 votes |
private void shareToQQForMedia(String title, String summary, String targetUrl, String thumbUrl, Activity activity, ShareListener listener) { if (mTencent == null) { listener.shareFailure(new Exception("分享失败")); recycle(); activity.finish(); return; } if (listener != null) { listener.shareStart(); } final Bundle params = new Bundle(); params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_DEFAULT); params.putString(QQShare.SHARE_TO_QQ_TITLE, title); params.putString(QQShare.SHARE_TO_QQ_SUMMARY, summary); params.putString(QQShare.SHARE_TO_QQ_TARGET_URL, targetUrl); params.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, thumbUrl); mTencent.shareToQQ(activity, params, listener); recycle(); }
Example #11
Source File: QQBaseShareInstance.java From SimpleProject with MIT License | 6 votes |
@Override public void onShare(String title, String desc, String iconUrl, String url) { if (tencent != null) { Bundle params = new Bundle(); if (flowId == ShareConstants.SHARE_BY_QQ) { params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_DEFAULT); params.putString(QQShare.SHARE_TO_QQ_TITLE, title); params.putString(QQShare.SHARE_TO_QQ_SUMMARY, desc); params.putString(QQShare.SHARE_TO_QQ_TARGET_URL, url); params.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, iconUrl); tencent.shareToQQ(activity, params, this); } else { final ArrayList<String> imageList = new ArrayList<>(); imageList.add(iconUrl); params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE, QzoneShare.SHARE_TO_QZONE_TYPE_IMAGE_TEXT); params.putString(QzoneShare.SHARE_TO_QQ_TITLE, title); params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, desc); params.putString(QzoneShare.SHARE_TO_QQ_TARGET_URL, url); params.putStringArrayList(QzoneShare.SHARE_TO_QQ_IMAGE_URL, imageList); tencent.shareToQzone(activity, params, this); } } }
Example #12
Source File: BaseDialog.java From AssistantBySDK with Apache License 2.0 | 5 votes |
private void shareToQQ() { if (isPkgInstalled("com.tencent.mobileqq")) { final Bundle params = new Bundle(); params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_DEFAULT); params.putString(QQShare.SHARE_TO_QQ_TITLE, shareText); params.putString(QQShare.SHARE_TO_QQ_SUMMARY, mContext.getResources().getString(R.string.shareDescription)); params.putString(QQShare.SHARE_TO_QQ_TARGET_URL, shareLink); params.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, "http://www.lingjuai.com/product/images/logo.png"); params.putString(QQShare.SHARE_TO_QQ_APP_NAME, "灵聚智能助理"); mTencent.shareToQQ((Activity) mContext, params, new BaseUiListener()); } else { new CommonDialog(getActivity(), "温馨提示", "未检测到“QQ”应用", "确定").show(); } }
Example #13
Source File: QQShareProxy.java From ESSocialSDK with Apache License 2.0 | 5 votes |
public static void shareToQQ(Context context, String appId, String title, String summary, String url, String imageUrl, String appName, IUiListener listener) { Bundle params = new Bundle(); params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_DEFAULT); params.putString(QQShare.SHARE_TO_QQ_TITLE, title); params.putString(QQShare.SHARE_TO_QQ_SUMMARY, summary); params.putString(QQShare.SHARE_TO_QQ_TARGET_URL, url); params.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, imageUrl); params.putString(QQShare.SHARE_TO_QQ_APP_NAME, appName); Tencent tencent = getInstance(context, appId); tencent.shareToQQ((Activity) context, params, listener); }
Example #14
Source File: QQHelper.java From android-common-utils with Apache License 2.0 | 5 votes |
/** 纯图片分享,只支持本地 */ public void shareOnlyImage(Activity activity,String appName,String fullPath,IQQCallback callbak){ this.mShareCallback = callbak; Bundle params = new Bundle(); params.putString(QQShare.SHARE_TO_QQ_IMAGE_LOCAL_URL,fullPath); params.putString(QQShare.SHARE_TO_QQ_APP_NAME, appName); params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_IMAGE); // showToast("在好友选择列表会自动打开分享到qzone的弹窗~~~"); params.putInt(QQShare.SHARE_TO_QQ_EXT_INT, QQShare.SHARE_TO_QQ_FLAG_QZONE_AUTO_OPEN); mTencent.shareToQQ(activity, params, mShareListener); }
Example #15
Source File: SharePopWindow.java From QiQuYing with Apache License 2.0 | 5 votes |
/** * 分享到QQ好友 */ private void share2QQFriends() { final Bundle params = new Bundle(); params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_DEFAULT); switch (mJoke.getType()) { case Joke.TYPE_QUSHI: params.putString(QQShare.SHARE_TO_QQ_TITLE, context.getString(R.string.share_title_qushi)); params.putString(QQShare.SHARE_TO_QQ_SUMMARY, mJoke.getContent().trim()); //这里应该填写应用图标的图片 params.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, appLogoUrl); break; case Joke.TYPE_QUTU: params.putString(QQShare.SHARE_TO_QQ_TITLE, context.getString(R.string.share_title_qutu)); params.putString(QQShare.SHARE_TO_QQ_SUMMARY, mJoke.getTitle()); params.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, mJoke.getImgUrl()); break; case Joke.TYPE_MEITU: params.putString(QQShare.SHARE_TO_QQ_TITLE, context.getString(R.string.share_title_meitu)); params.putString(QQShare.SHARE_TO_QQ_SUMMARY, mJoke.getTitle()); params.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, mJoke.getImgUrl()); break; } //加入点击链接 params.putString(QQShare.SHARE_TO_QQ_TARGET_URL, targetUrl + mJoke.getId()); params.putString(QQShare.SHARE_TO_QQ_APP_NAME, context.getString(R.string.app_name)); App.mTencent.shareToQQ((Activity)context, params, iUiListener); }
Example #16
Source File: QQShareManager.java From sharesdk with Apache License 2.0 | 5 votes |
QQShareManager(Context context) { mAppId = ShareSDK.getInstance().getQQAppId(); mContext = context; if (!TextUtils.isEmpty(mAppId)) { mTencent = Tencent.createInstance(mAppId, context); mQQShare = new QQShare(context, mTencent.getQQToken()); mQZoneShare = new QzoneShare(context, mTencent.getQQToken()); } }
Example #17
Source File: Share.java From UPMiss with GNU General Public License v3.0 | 5 votes |
private static void shareToQQ(Activity activity, String title, String summary, Bitmap img) { String path = FileTool.saveBitmap(img, "Image", "Share.png"); if (path == null) return; final Bundle params = new Bundle(); params.putString(QQShare.SHARE_TO_QQ_TITLE, title + Constants.SUMMARY); params.putString(QQShare.SHARE_TO_QQ_TARGET_URL, Constants.TARGET_URL); params.putString(QQShare.SHARE_TO_QQ_SUMMARY, summary); params.putString(QQShare.SHARE_TO_QQ_IMAGE_LOCAL_URL, path); params.putString(QQShare.SHARE_TO_QQ_APP_NAME, Constants.APP_NAME); params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_IMAGE); params.putInt(QQShare.SHARE_TO_QQ_EXT_INT, 0x00); getTencent(activity).shareToQQ(activity, params, getQQShareListener(activity)); }
Example #18
Source File: QQShareInstance.java From smart-farmer-android with Apache License 2.0 | 5 votes |
private void shareToQQForMedia(String title, String summary, String targetUrl, String thumbUrl, Activity activity, ShareListener listener) { final Bundle params = new Bundle(); params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_DEFAULT); params.putString(QQShare.SHARE_TO_QQ_TITLE, title); params.putString(QQShare.SHARE_TO_QQ_SUMMARY, summary); params.putString(QQShare.SHARE_TO_QQ_TARGET_URL, targetUrl); params.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, thumbUrl); mTencent.shareToQQ(activity, params, listener); }
Example #19
Source File: QQShareInstance.java From ShareUtil with Apache License 2.0 | 5 votes |
private void shareToQQForMedia(String title, String summary, String targetUrl, String thumbUrl, Activity activity, ShareListener listener) { final Bundle params = new Bundle(); params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_DEFAULT); params.putString(QQShare.SHARE_TO_QQ_TITLE, title); params.putString(QQShare.SHARE_TO_QQ_SUMMARY, summary); params.putString(QQShare.SHARE_TO_QQ_TARGET_URL, targetUrl); params.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, thumbUrl); mTencent.shareToQQ(activity, params, listener); }
Example #20
Source File: ShareModel.java From Android-Application-ZJB with Apache License 2.0 | 5 votes |
private void shareImage2QQ(WXEntryActivity activity, ShareBean bean, int type) { getShareImagePath(bean) .doOnSubscribe(this::showProgressDialog) .subscribe(path -> { // extarFlag ==1 会弹出发送到QQ控件的对话框,为0则不会弹出 int extarFlag = 0; //2.确定分享类型 int shareType = type == IShareProvider.SHARE_CONTENT_TYPE_IMAGE ? QQShare.SHARE_TO_QQ_TYPE_IMAGE : QQShare.SHARE_TO_QQ_TYPE_DEFAULT; //3.构建分享的参数 final Bundle params = new Bundle(); if (shareType != QQShare.SHARE_TO_QQ_TYPE_IMAGE) { if (!TextUtils.isEmpty(bean.getTitle())) { params.putString(QQShare.SHARE_TO_QQ_TITLE, bean.getTitle()); } String targetUrl = bean.getTargetUrl(); params.putString(QQShare.SHARE_TO_QQ_TARGET_URL, UrlParserManager.getInstance().parsePlaceholderUrl(targetUrl)); if (!TextUtils.isEmpty(bean.getSummary())) { params.putString(QQShare.SHARE_TO_QQ_SUMMARY, bean.getSummary()); } } if (!TextUtils.isEmpty(bean.getImagePath())) { if (shareType == QQShare.SHARE_TO_QQ_TYPE_IMAGE) { params.putString(QQShare.SHARE_TO_QQ_IMAGE_LOCAL_URL, path); } else { params.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, path); } } params.putString(QQShare.SHARE_TO_QQ_APP_NAME, ResHelper.getString(R.string.app_name)); params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, shareType); params.putInt(QQShare.SHARE_TO_QQ_EXT_INT, extarFlag); mTencent.shareToQQ(activity, params, activity); }, e -> { UIHelper.shortToast(R.string.share_error); dismissProgressDialog(); Logger.f(e); }, this::dismissProgressDialog); }
Example #21
Source File: QQChatShareHandler.java From BiliShare with Apache License 2.0 | 5 votes |
@Override protected void shareAudio(ShareParamAudio params) throws ShareException { if (TextUtils.isEmpty(params.getTitle()) || TextUtils.isEmpty(params.getTargetUrl())) { throw new InvalidParamException("Title or target url is empty or illegal"); } if (TextUtils.isEmpty(params.getAudioUrl())) { throw new InvalidParamException("Audio url is empty or illegal"); } Log.d(TAG, "share audio"); final Bundle bundle = new Bundle(); ShareImage thumb = params.getThumb(); bundle.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_AUDIO); bundle.putString(QQShare.SHARE_TO_QQ_TITLE, params.getTitle()); bundle.putString(QQShare.SHARE_TO_QQ_SUMMARY, params.getContent()); bundle.putString(QQShare.SHARE_TO_QQ_TARGET_URL, params.getTargetUrl()); if (thumb != null) { if (thumb.isNetImage()) { bundle.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, thumb.getNetImageUrl()); } else if (thumb.isLocalImage()) { bundle.putString(QQShare.SHARE_TO_QQ_IMAGE_LOCAL_URL, thumb.getLocalPath()); } } bundle.putString(QQShare.SHARE_TO_QQ_AUDIO_URL, params.getAudioUrl()); doShareToQQ((Activity) getContext(), bundle); }
Example #22
Source File: QQPlatform.java From SocialSdkLibrary with Apache License 2.0 | 5 votes |
private void shareMusic(int shareTarget, Activity activity, ShareObj obj) { if (shareTarget == Target.SHARE_QQ_FRIENDS) { Bundle params = buildCommonBundle(obj.getTitle(), obj.getSummary(), obj.getTargetUrl(), shareTarget); params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_AUDIO); if (!TextUtils.isEmpty(obj.getThumbImagePath())) params.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, obj.getThumbImagePath()); params.putString(QQShare.SHARE_TO_QQ_AUDIO_URL, obj.getMediaPath()); mTencentApi.shareToQQ(activity, params, mIUiListenerWrap); } else if (shareTarget == Target.SHARE_QQ_ZONE) { shareWeb(shareTarget, activity, obj); } }
Example #23
Source File: QQPlatform.java From SocialSdkLibrary with Apache License 2.0 | 5 votes |
private void shareApp(int shareTarget, Activity activity, ShareObj obj) { if (shareTarget == Target.SHARE_QQ_FRIENDS) { Bundle params = buildCommonBundle(obj.getTitle(), obj.getSummary(), obj.getTargetUrl(), shareTarget); params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_APP); if (!TextUtils.isEmpty(obj.getThumbImagePath())) params.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, obj.getThumbImagePath()); mTencentApi.shareToQQ(activity, params, mIUiListenerWrap); } else if (shareTarget == Target.SHARE_QQ_ZONE) { shareWeb(shareTarget, activity, obj); } }
Example #24
Source File: QQShareEntity.java From SocialHelper with Apache License 2.0 | 5 votes |
/** * 创建分享图文到qq空间 * * @param title 标题,长度限制200个字符 * @param targetUrl 跳转地址 * @param imgUrl 图片地址,目前会第一张有效,待qq优化 * @param summary 摘要,长度限制600个字 * @param appName 应用名;手Q客户端顶部,替换“返回”按钮文字,如果为空,用返回代替 */ public static ShareEntity createImageTextInfoToQZone(@ParamsRequired String title, @ParamsRequired String targetUrl, @ParamsRequired ArrayList<String> imgUrl, String summary, String appName) { ShareEntity entity = new ShareEntity(ShareEntity.TYPE_Q_ZONE); addParams(entity.params, QzoneShare.SHARE_TO_QZONE_KEY_TYPE, QzoneShare.SHARE_TO_QZONE_TYPE_IMAGE_TEXT); addParams(entity.params, QzoneShare.SHARE_TO_QQ_TITLE, title); addParams(entity.params, QQShare.SHARE_TO_QQ_TARGET_URL, targetUrl); addParams(entity.params, QzoneShare.SHARE_TO_QQ_IMAGE_URL, imgUrl); addParams(entity.params, QzoneShare.SHARE_TO_QQ_SUMMARY, summary); addParams(entity.params, QzoneShare.SHARE_TO_QQ_APP_NAME, appName); return entity; }
Example #25
Source File: QQShareEntity.java From SocialHelper with Apache License 2.0 | 5 votes |
/** * 创建分享应用到qq * * @param title 标题,长度限制30个字符 * @param imgUrl 图片地址,本地路径或者url * @param summary 摘要,长度限制40个字 * @param appName 应用名;手Q客户端顶部,替换“返回”按钮文字,如果为空,用返回代替 */ public static ShareEntity createAppInfo(@ParamsRequired String title, String imgUrl, String summary, String appName) { ShareEntity entity = new ShareEntity(ShareEntity.TYPE_QQ); addParams(entity.params, QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_APP); addParams(entity.params, QQShare.SHARE_TO_QQ_TITLE, title); addParams(entity.params, QQShare.SHARE_TO_QQ_IMAGE_URL, imgUrl); addParams(entity.params, QQShare.SHARE_TO_QQ_SUMMARY, summary); addParams(entity.params, QQShare.SHARE_TO_QQ_APP_NAME, appName); return entity; }
Example #26
Source File: QQShareEntity.java From SocialHelper with Apache License 2.0 | 5 votes |
/** * 创建分享音乐到qq * * @param title 标题,长度限制30个字符 * @param targetUrl 跳转地址, * @param musicUrl 音乐地址,不支持本地音乐 * @param imgUrl 图片地址,本地路径或者url * @param summary 摘要,长度限制40个字 * @param appName 应用名;手Q客户端顶部,替换“返回”按钮文字,如果为空,用返回代替 */ public static ShareEntity createMusicInfo(@ParamsRequired String title, @ParamsRequired String targetUrl, @ParamsRequired String musicUrl, String imgUrl, String summary, String appName) { ShareEntity entity = new ShareEntity(ShareEntity.TYPE_QQ); addParams(entity.params, QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_AUDIO); addParams(entity.params, QQShare.SHARE_TO_QQ_TITLE, title); addParams(entity.params, QQShare.SHARE_TO_QQ_TARGET_URL, targetUrl); addParams(entity.params, QQShare.SHARE_TO_QQ_AUDIO_URL, musicUrl); addParams(entity.params, QQShare.SHARE_TO_QQ_IMAGE_URL, imgUrl); addParams(entity.params, QQShare.SHARE_TO_QQ_SUMMARY, summary); addParams(entity.params, QQShare.SHARE_TO_QQ_APP_NAME, appName); return entity; }
Example #27
Source File: QQShareEntity.java From SocialHelper with Apache License 2.0 | 5 votes |
/** * 创建分享纯图片到qq * * @param imgUrl 本地图片地址 * @param appName 应用名;手Q客户端顶部,替换“返回”按钮文字,如果为空,用返回代替 */ public static ShareEntity createImageInfo(@ParamsRequired String imgUrl, String appName) { ShareEntity entity = new ShareEntity(ShareEntity.TYPE_QQ); addParams(entity.params, QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_IMAGE); addParams(entity.params, QQShare.SHARE_TO_QQ_IMAGE_LOCAL_URL, imgUrl); addParams(entity.params, QQShare.SHARE_TO_QQ_APP_NAME, appName); return entity; }
Example #28
Source File: QQShareEntity.java From SocialHelper with Apache License 2.0 | 5 votes |
/** * 创建分享图文类型到qq * * @param title 标题,长度限制30个字符 * @param targetUrl 跳转地址 * @param imgUrl 图片地址,本地路径或者url * @param summary 摘要,长度限制40个字 * @param appName 应用名;手Q客户端顶部,替换“返回”按钮文字,如果为空,用返回代替 */ public static ShareEntity createImageTextInfo(@ParamsRequired String title, @ParamsRequired String targetUrl, String imgUrl, String summary, String appName) { ShareEntity entity = new ShareEntity(ShareEntity.TYPE_QQ); addParams(entity.params, QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_DEFAULT); addParams(entity.params, QQShare.SHARE_TO_QQ_TITLE, title); addParams(entity.params, QQShare.SHARE_TO_QQ_TARGET_URL, targetUrl); addParams(entity.params, QQShare.SHARE_TO_QQ_IMAGE_URL, imgUrl); addParams(entity.params, QQShare.SHARE_TO_QQ_SUMMARY, summary); addParams(entity.params, QQShare.SHARE_TO_QQ_APP_NAME, appName); return entity; }
Example #29
Source File: AppbarActivity.java From letv with Apache License 2.0 | 5 votes |
public void shareToQQ() { final QQToken token = getToken(); if (token != null) { QQShare qQShare = new QQShare(this, token); Bundle bundle = new Bundle(); bundle.putString("title", this.model.a); bundle.putString("targetUrl", this.model.d); bundle.putString("summary", this.model.b); bundle.putString("imageUrl", this.model.c); f.b(f.d, "-->(AppbarActivity)shareToQQ : model.mTitle = " + this.model.a); f.b(f.d, "-->(AppbarActivity)shareToQQ : model.mTargetUrl = " + this.model.d); f.b(f.d, "-->(AppbarActivity)shareToQQ : model.mDescription = " + this.model.b); f.b(f.d, "-->(AppbarActivity)shareToQQ : model.mIconUrl = " + this.model.c); qQShare.shareToQQ(this, bundle, new IUiListener(this) { final /* synthetic */ AppbarActivity b; public void onError(UiError uiError) { f.b(f.d, "-->(AppbarActivity)shareToQQ onError"); this.b.jsBridge.responseShareFail(1); } public void onComplete(Object obj) { f.b(f.d, "-->(AppbarActivity)shareToQQ onComplete"); this.b.jsBridge.responseShare(1); a.a(token.getAppId(), PLAYER.PLAY, "SDK.APPBAR.HOME.SHARE.QQ"); } public void onCancel() { f.b(f.d, "-->(AppbarActivity)shareToQQ onCancel"); this.b.jsBridge.responseShareFail(1); } }); a.a(token.getAppId(), "200", "SDK.APPBAR.HOME.SHARE.QQ"); } }
Example #30
Source File: AnticipationRedPacketActivity.java From PocketEOS-Android with GNU Lesser General Public License v3.0 | 4 votes |
@OnClick({R.id.go_weixin_friend, R.id.go_weixin_circle, R.id.go_qq_friend, R.id.go_qzone}) public void onViewClicked(View view) { Bundle params = new Bundle(); if (!TextUtils.isEmpty(message)) { presenter.getAuthRedPacketData(mDataBean.getId(), getIntent().getStringExtra("txtid")); } else { switch (view.getId()) { case R.id.go_weixin_friend: WxShareAndLoginUtils.WxUrlShare(AnticipationRedPacketActivity.this, "https://pocketeos.com", getString(R.string.share_redpacket_title), getString(R.string.share_redpacket_message), MyApplication.getInstance().getUserBean().getWallet_img(), WxShareAndLoginUtils.WECHAT_FRIEND); break; case R.id.go_weixin_circle: WxShareAndLoginUtils.WxUrlShare(AnticipationRedPacketActivity.this, "https://pocketeos.com", getString(R.string.share_redpacket_title), getString(R.string.share_redpacket_message), MyApplication.getInstance().getUserBean().getWallet_img(), WxShareAndLoginUtils.WECHAT_MOMENT); break; case R.id.go_qq_friend: params.putInt(QQShare.SHARE_TO_QQ_KEY_TYPE, QQShare.SHARE_TO_QQ_TYPE_DEFAULT); params.putString(QQShare.SHARE_TO_QQ_TITLE, getString(R.string.share_redpacket_title));// 标题 params.putString(QQShare.SHARE_TO_QQ_SUMMARY, getString(R.string.share_redpacket_message));// 摘要 params.putString(QQShare.SHARE_TO_QQ_TARGET_URL, "http://192.168.33.17:8081?id=" + mDataBean.getId() + "&verifystring=" + mDataBean.getVerifyString());// 内容地址 params.putString(QQShare.SHARE_TO_QQ_IMAGE_URL, "http://pocketeos.oss-cn-beijing.aliyuncs.com/yl/pocketeos.png?Expires=1839400748&OSSAccessKeyId=LTAIdWMZ4ikcYbmF&Signature=dAyqIz3DfCq4emFtdUu%2F%2Fq7kQYU%3D");// 网络图片地址 params.putString(QQShare.SHARE_TO_QQ_EXT_INT, "其它附加功能"); MyApplication.getInstance().getTencent().shareToQQ(AnticipationRedPacketActivity.this, params, new BaseUIListener(AnticipationRedPacketActivity.this, true)); break; case R.id.go_qzone: params.putInt(QzoneShare.SHARE_TO_QZONE_KEY_TYPE, QzoneShare.SHARE_TO_QZONE_TYPE_IMAGE_TEXT); params.putString(QzoneShare.SHARE_TO_QQ_TITLE, getString(R.string.share_redpacket_title));// 标题 params.putString(QzoneShare.SHARE_TO_QQ_SUMMARY, getString(R.string.share_redpacket_message));// 摘要 params.putString(QzoneShare.SHARE_TO_QQ_TARGET_URL, "https://pocketeos.com");// 内容地址 ArrayList<String> imgUrlList = new ArrayList<>(); imgUrlList.add("http://pocketeos.oss-cn-beijing.aliyuncs.com/yl/pocketeos.png?Expires=1839400748&OSSAccessKeyId=LTAIdWMZ4ikcYbmF&Signature=dAyqIz3DfCq4emFtdUu%2F%2Fq7kQYU%3D"); params.putStringArrayList(QzonePublish.PUBLISH_TO_QZONE_IMAGE_URL, imgUrlList);// 图片地址ArrayList MyApplication.getInstance().getTencent().shareToQzone(AnticipationRedPacketActivity.this, params, new BaseUIListener(AnticipationRedPacketActivity.this, true)); break; } } }