接口函数
public static void shareImg(final String text, final String img) {
mContext.runOnUiThread(new Runnable() {
@Override
public void run() {
// getInstance().mController.setShareContent(text);
UMImage image = null;
try {
if (img.startsWith("http")) {
image = new UMImage(mContext, img);
} else {
image = new UMImage(mContext, BitmapFactory.decodeFile(img));
// image = new UMImage(mContext, new File(img));
// image = new UMImage(mContext, BitmapFactory.decodeStream(mContext.getAssets().open(img)));
}
} catch (Exception e) {
image = null;
}
if (null != image) {
getInstance().mController.setShareMedia(new UMImage(mContext, img));
}
getInstance().mController.openShare(mContext, false);
}
});
}