升级友盟导致Databinding找不到
这个很坑,我是从友盟6.9.4升级到7.0.2 导致databinding找不到
错误
解决办法
这个问题折腾了好久:
几个思路:
- 以为是7.0.2升级版本里面方法改了,但是我把友盟代码全部去掉,再重新接入,是可以分享的。
- jar可能不实用了,我就用了build.gradle方法。发现还不行
- 可能是项目引入的地方太多,更新jar, AS不能及时处理。
最后,我打算自己新建一个方法类,专门友盟的管理。除了这个地方引用,其他地方都不引用友盟。
注意:我把统计的代码也通过这个方式替换了
代码
package com.yqzbw.yqms.lb.util;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.util.Log;
import com.istarshine.base.BaseApplication;
import com.istarshine.common.ShareUtils;
import com.umeng.socialize.ShareAction;
import com.umeng.socialize.UMShareAPI;
import com.umeng.socialize.UMShareListener;
import com.umeng.socialize.bean.SHARE_MEDIA;
import com.umeng.socialize.media.UMImage;
import com.umeng.socialize.media.UMWeb;
import com.umeng.socialize.utils.SocializeUtils;
import com.yqzbw.yqms.lb.activity.R;
import com.yqzbw.yqms.lb.conf.UmengAnalysisConstants;
public class SocialShareUtils {
public static void getrelease(Context context) {
UMShareAPI.get(context).release();
}
public static void getonActivityResult(Context context, int requestCode, int resultCode, Intent data) {
UMShareAPI.get(context).onActivityResult(requestCode, resultCode, data);
}
public static void shareQQ(String mShareUrl, String title) {
shareQQ(mShareUrl, title, " ", null);
}
public static void shareQQ(String mShareUrl, String title, String desc) {
shareQQ(mShareUrl, title, desc, null);
}
public static void shareQQ(String mShareUrl, String title, ProgressDialog dialog) {
shareQQ(mShareUrl, title, " ", dialog);
}
public static void shareQQ(String mShareUrl, String title, String desc, Bitmap mShareBitmap, ProgressDialog dialog) {
UMWeb web = new UMWeb(mShareUrl);
web.setTitle(title);
web.setThumb(new UMImage(BaseApplication.getAppContextBase(), mShareBitmap));
web.setDescription(desc);
SocialShareUtils.shareQQ(web, shareListener.setDialog(dialog));
}
public static void shareQQ(String mShareUrl, String title, String desc, ProgressDialog dialog) {
UMWeb web = new UMWeb(mShareUrl);
web.setTitle(title);
web.setThumb(new UMImage(BaseApplication.getAppContextBase(), R.mipmap.icon2));
web.setDescription(desc);
SocialShareUtils.shareQQ(web, shareListener.setDialog(dialog));
}
/**
* UMENG_SHARE_QQ
* UMENG_SHARE_WECHAT
* UMENG_SHARE_FRIENDS
* UMENG_SHARE_QZONE
* UMENG_SHARE_SMS
*/
public static final void shareQQ(UMWeb web, UMShareListener shareListener) {
UmengUtil.onEvent(UmengAnalysisConstants.UMENG_SHARE_QQ);
if (BaseApplication.getAppActivityBase() != null) {
new ShareAction(BaseApplication.getAppActivityBase())
.withText("")
.withMedia(web)
.setPlatform(SHARE_MEDIA.QQ)
.setCallback(shareListener).share();
}
Log.i(SocialShareUtils.class.getSimpleName(), "shareQQ");
}
public static void shareWeiChat(String mShareUrl, String title) {
shareWeiChat(mShareUrl, title, " ", null);
}
public static void shareWeiChat(String mShareUrl, String title, String desc) {
shareWeiChat(mShareUrl, title, desc, null);
}
public static void shareWeiChat(String mShareUrl, String title, ProgressDialog dialog) {
shareWeiChat(mShareUrl, title, " ", dialog);
}
public static void shareWeiChat(String mShareUrl, String title, String desc, Bitmap mShareBitmap, ProgressDialog dialog) {
UMWeb web = new UMWeb(mShareUrl);
web.setTitle(title);
web.setThumb(new UMImage(BaseApplication.getAppContextBase(), mShareBitmap));
web.setDescription(desc);
SocialShareUtils.shareWeiChat(web, shareListener.setDialog(dialog));
}
public static void shareWeiChat(String mShareUrl, String title, String desc, ProgressDialog dialog) {
UMWeb web = new UMWeb(mShareUrl);
web.setTitle(title);
web.setThumb(new UMImage(BaseApplication.getAppContextBase(), R.mipmap.icon2));
web.setDescription(desc);
SocialShareUtils.shareWeiChat(web, shareListener.setDialog(dialog));
}
public static final void shareWeiChat(UMWeb web, UMShareListener shareListener) {
UmengUtil.onEvent(UmengAnalysisConstants.UMENG_SHARE_WECHAT);
if (BaseApplication.getAppActivityBase() != null) {
new ShareAction(BaseApplication.getAppActivityBase())
.withText("")
.withMedia(web)
.setPlatform(SHARE_MEDIA.WEIXIN)
.setCallback(shareListener).share();
// SocialShareUtils.shareWeiChat(web, shareListener);
}
Log.i(SocialShareUtils.class.getSimpleName(), "shareWeiChat");
}
public static void shareFriends(String mShareUrl, String title) {
shareFriends(mShareUrl, title, " ", null);
}
public static void shareFriends(String mShareUrl, String title, String desc) {
shareFriends(mShareUrl, title, desc, null);
}
public static void shareFriends(String mShareUrl, String title, ProgressDialog dialog) {
shareFriends(mShareUrl, title, " ", dialog);
}
public static void shareFriends(String mShareUrl, String title, String desc, Bitmap mShareBitmap, ProgressDialog dialog) {
UMWeb web = new UMWeb(mShareUrl);
web.setTitle(title);
web.setThumb(new UMImage(BaseApplication.getAppContextBase(), mShareBitmap));
web.setDescription(desc);
SocialShareUtils.shareFriends(web, shareListener.setDialog(dialog));
}
public static void shareFriends(String mShareUrl, String title, String desc, ProgressDialog dialog) {
UMWeb web = new UMWeb(mShareUrl);
web.setTitle(title);
web.setThumb(new UMImage(BaseApplication.getAppContextBase(), R.mipmap.icon2));
web.setDescription(desc);
SocialShareUtils.shareFriends(web, shareListener.setDialog(dialog));
}
public static final void shareFriends(UMWeb web, UMShareListener shareListener) {
UmengUtil.onEvent(UmengAnalysisConstants.UMENG_SHARE_FRIENDS);
if (BaseApplication.getAppActivityBase() != null) {
new ShareAction(BaseApplication.getAppActivityBase())
.withText("")
.withMedia(web)
.setPlatform(SHARE_MEDIA.WEIXIN_CIRCLE)
.setCallback(shareListener).share();
// SocialShareUtils.shareFriends(web, shareListener);
}
Log.i(SocialShareUtils.class.getSimpleName(), "shareFriends");
}
public static void shareQZone(String mShareUrl, String title) {
shareQZone(mShareUrl, title, " ", null);
}
public static void shareQZone(String mShareUrl, String title, String desc) {
shareQZone(mShareUrl, title, desc, null);
}
public static void shareQZone(String mShareUrl, String title, ProgressDialog dialog) {
shareQZone(mShareUrl, title, " ", dialog);
}
public static void shareQZone(String mShareUrl, String title, String desc, Bitmap mShareBitmap, ProgressDialog dialog) {
UMWeb web = new UMWeb(mShareUrl);
web.setTitle(title);
web.setThumb(new UMImage(BaseApplication.getAppContextBase(), mShareBitmap));
web.setDescription(desc);
SocialShareUtils.shareQZone(web, shareListener.setDialog(dialog));
}
public static void shareQZone(String mShareUrl, String title, String desc, ProgressDialog dialog) {
UMWeb web = new UMWeb(mShareUrl);
web.setTitle(title);
web.setThumb(new UMImage(BaseApplication.getAppContextBase(), R.mipmap.icon2));
web.setDescription(desc);
SocialShareUtils.shareQZone(web, shareListener.setDialog(dialog));
}
public static final void shareQZone(UMWeb web, UMShareListener shareListener) {
UmengUtil.onEvent(UmengAnalysisConstants.UMENG_SHARE_QZONE);
if (BaseApplication.getAppActivityBase() != null) {
new ShareAction(BaseApplication.getAppActivityBase())
.withText("")
.withMedia(web)
.setPlatform(SHARE_MEDIA.DINGTALK)
.setCallback(shareListener).share();
// SocialShareUtils.shareQZone(web, shareListener);
}
Log.i(SocialShareUtils.class.getSimpleName(), "shareQZone");
}
public static void shareDingTalk(String mShareUrl, String title) {
shareDingTalk(mShareUrl, title, " ", null);
}
public static void shareDingTalk(String mShareUrl, String title, String desc) {
shareDingTalk(mShareUrl, title, desc, null);
}
public static void shareDingTalk(String mShareUrl, String title, ProgressDialog dialog) {
shareDingTalk(mShareUrl, title, " ", dialog);
}
public static void shareDingTalk(String mShareUrl, String title, String desc, Bitmap mShareBitmap, ProgressDialog dialog) {
UMWeb web = new UMWeb(mShareUrl);
web.setTitle(title);
web.setThumb(new UMImage(BaseApplication.getAppContextBase(), mShareBitmap));
web.setDescription(desc);
SocialShareUtils.shareDingTalk(web, shareListener.setDialog(dialog));
}
public static void shareDingTalk(String mShareUrl, String title, String desc, ProgressDialog dialog) {
UMWeb web = new UMWeb(mShareUrl);
web.setTitle(title);
web.setThumb(new UMImage(BaseApplication.getAppContextBase(), R.mipmap.icon2));
web.setDescription(desc);
SocialShareUtils.shareDingTalk(web, shareListener.setDialog(dialog));
}
public static final void shareDingTalk(UMWeb web, UMShareListener shareListener) {
UmengUtil.onEvent(UmengAnalysisConstants.UMENG_SHARE_QZONE);
if (BaseApplication.getAppActivityBase() != null) {
new ShareAction(BaseApplication.getAppActivityBase())
.withText("")
.withMedia(web)
.setPlatform(SHARE_MEDIA.DINGTALK)
.setCallback(shareListener).share();
// SocialShareUtils.shareQZone(web, shareListener);
}
Log.i(SocialShareUtils.class.getSimpleName(), "shareDingTalk");
}
public static final void shareSms(String string) {
UmengUtil.onEvent(UmengAnalysisConstants.UMENG_SHARE_SMS);
ShareUtils.shareDX(string);
Log.i(SocialShareUtils.class.getSimpleName(), "shareDX");
}
private static abstract class MyUMShareListener implements UMShareListener {
protected ProgressDialog dialog;
public MyUMShareListener setDialog(ProgressDialog dialog) {
this.dialog = dialog;
return this;
}
}
private static MyUMShareListener shareListener = new MyUMShareListener() {
@Override
public void onStart(SHARE_MEDIA platform) {
SocializeUtils.safeShowDialog(dialog);
}
@Override
public void onResult(SHARE_MEDIA platform) {
ToastUtil.popupMessage(BaseApplication.getAppContextBase(), "分享成功");
SocializeUtils.safeCloseDialog(dialog);
}
@Override
public void onError(SHARE_MEDIA platform, Throwable t) {
SocializeUtils.safeCloseDialog(dialog);
ToastUtil.popupMessage(BaseApplication.getAppContextBase(), "分享失败");
}
@Override
public void onCancel(SHARE_MEDIA platform) {
SocializeUtils.safeCloseDialog(dialog);
}
};
}
原jar包
新jar包
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.fwqtg.net
哈喽大家好,我是咸鱼。今天给大家分享一个关于 HTTP 有趣的现象 链接:https://csvbase.com/meripaterson/stock-exchanges 我们用浏览器访问这个链接,可以看到下面的网页 但如果我们使用 curl 命令去访问这个链…