您好,登錄后才能下訂單哦!
問題是把清單文件里面的
<data android:scheme="tencent*******" />
設置為tencent+appid,記得前面一定要加“tencent”,另外,appid得是在騰訊開放后臺申請的
代碼里面如下:
(Bundle savedInstanceState) { .onCreate(savedInstanceState)setContentView(R.layout.)initUi()initMap()initSocialSDK()} () { .put(shareType.SHARE_MEDIA.).put(shareType.SHARE_MEDIA.).put(shareType.SHARE_MEDIA.).put(shareType.SHARE_MEDIA.).put(shareType.SHARE_MEDIA.)}
/** * 初始化SDK,添加一些平臺 */ private void initSocialSDK() { // 添加QQ平臺 UMQQSsoHandler qqHandler = new UMQQSsoHandler(content, UmengUtil.QQ_AppId, UmengUtil.QQ_APPKEY); qqHandler.addToSocialSDK(); // 添加QQ空間平臺 QZoneSsoHandler qzoneHandler = new QZoneSsoHandler(content, UmengUtil.QQ_AppId, UmengUtil.QQ_APPKEY); qzoneHandler.addToSocialSDK(); UMWXHandler wxHandler = new UMWXHandler(content, WxConstants.APP_ID, WxConstants.App_Secret); wxHandler.addToSocialSDK(); // 支持微信朋友圈 UMWXHandler wxCircleHandler = new UMWXHandler(content, WxConstants.APP_ID, WxConstants.App_Secret); wxCircleHandler.setToCircle(true); wxCircleHandler.addToSocialSDK(); }
(View v) { (v.getId()) { R.id.: finish()R.id.: setShareContent(Configs.shareContent, Configs.shareTitle, url, shareType.QQ);
(String contentStrString titleString targetUrlshareType type) { .registerListener()(type == shareType.) { WeiXinShareContent weixinContent = WeiXinShareContent()weixinContent.setShareContent(contentStr)weixinContent.setTitle(title)weixinContent.setTargetUrl(targetUrl)weixinContent.setShareImage().setShareMedia(weixinContent)} (type == shareType.) { CircleShareContent circleMedia = CircleShareContent()circleMedia.setTitle(title)circleMedia.setShareContent(contentStr)circleMedia.setTargetUrl(targetUrl)circleMedia.setShareImage().setShareMedia(circleMedia)} (type == shareType.) { SinaShareContent sinaContent = SinaShareContent().getConfig().setSinaCallbackUrl()sinaContent.setShareContent(contentStr + targetUrl)sinaContent.setAppWebSite(targetUrl)sinaContent.setTargetUrl(targetUrl)sinaContent.setShareImage().setShareMedia(sinaContent)} (type == shareType.) { QQShareContent qqShareContent = QQShareContent()qqShareContent.setShareContent(contentStr)qqShareContent.setTitle(title)qqShareContent.setTargetUrl(targetUrl).setShareMedia(qqShareContent)} { .setShareContent()} .postShare(.get(type))}
SocializeListeners.SnsPostListener = SocializeListeners.SnsPostListener() { () { Log.()} (SHARE_MEDIA platformstCodeSocializeEntity entity) { Log.(+ stCode)(stCode == ) { Toast.(Toast.) .show()} { Toast.(+ stCodeToast.) .show()} } }
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。