本文整理汇总了Java中com.tencent.mm.sdk.modelmsg.WXMediaMessage.IMediaObject方法的典型用法代码示例。如果您正苦于以下问题:Java WXMediaMessage.IMediaObject方法的具体用法?Java WXMediaMessage.IMediaObject怎么用?Java WXMediaMessage.IMediaObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.tencent.mm.sdk.modelmsg.WXMediaMessage
的用法示例。
在下文中一共展示了WXMediaMessage.IMediaObject方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: genMsg
import com.tencent.mm.sdk.modelmsg.WXMediaMessage; //导入方法依赖的package包/类
public static WXMediaMessage genMsg(WXMediaMessage.IMediaObject mediaObject
, String description, String title
, Bitmap thumbBmp) {
if (null == mediaObject) {
throw new RuntimeException("Please initialize the mediaObject");
}
if (TextUtils.isEmpty(description)) {
throw new RuntimeException("Please set description.");
}
WXMediaMessage msg = new WXMediaMessage();
msg.description = description;
msg.mediaObject = mediaObject;
if (!TextUtils.isEmpty(title)) {
msg.title = title;
}
if (null != thumbBmp) {
msg.thumbData = bmpToByteArray(thumbBmp, true);
}
return msg;
}
示例2: createMediaObject
import com.tencent.mm.sdk.modelmsg.WXMediaMessage; //导入方法依赖的package包/类
@Override
protected WXMediaMessage.IMediaObject createMediaObject() {
WXImageObject object = new WXImageObject();
switch (getShareParams().getImage().getSource()) {
case File:
object.imagePath = getShareParams().getImage().getImageFile().getPath();
break;
case Bitmap:
case Http:
object.imageData = ShareImageUtils.getCompressData(getShareParams().getImage(), MAX_IMAGE_SIZE);
thumbData = object.imageData;
break;
}
return object;
}
示例3: createMediaObject
import com.tencent.mm.sdk.modelmsg.WXMediaMessage; //导入方法依赖的package包/类
@Override
protected WXMediaMessage.IMediaObject createMediaObject() {
WXWebpageObject object = new WXWebpageObject();
object.webpageUrl = getShareParams().getTargetUrl();
return object;
}
示例4: createMediaObject
import com.tencent.mm.sdk.modelmsg.WXMediaMessage; //导入方法依赖的package包/类
@Override
protected WXMediaMessage.IMediaObject createMediaObject() {
WXTextObject object = new WXTextObject();
object.text = getShareParams().getContent();
return object;
}
示例5: createMediaObject
import com.tencent.mm.sdk.modelmsg.WXMediaMessage; //导入方法依赖的package包/类
protected abstract WXMediaMessage.IMediaObject createMediaObject();