• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java VKUploadWallPhotoRequest类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中com.vk.sdk.api.photo.VKUploadWallPhotoRequest的典型用法代码示例。如果您正苦于以下问题:Java VKUploadWallPhotoRequest类的具体用法?Java VKUploadWallPhotoRequest怎么用?Java VKUploadWallPhotoRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

VKUploadWallPhotoRequest类属于com.vk.sdk.api.photo包,在下文中一共展示了VKUploadWallPhotoRequest类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onClick

点赞 3

import com.vk.sdk.api.photo.VKUploadWallPhotoRequest; //导入依赖的package包/类
@Override
public void onClick(View view) {
	setIsLoading(true);
	if (mAttachmentImages != null && VKSdk.getAccessToken() != null) {
		final Long userId = Long.parseLong(VKSdk.getAccessToken().userId);
		VKUploadWallPhotoRequest photoRequest = new VKUploadWallPhotoRequest(mAttachmentImages, userId, 0);
		photoRequest.executeWithListener(new VKRequest.VKRequestListener() {
			@Override
			public void onComplete(VKResponse response) {
				VKPhotoArray photos = (VKPhotoArray) response.parsedModel;
				VKAttachments attachments = new VKAttachments(photos);
				makePostWithAttachments(attachments);
			}

			@Override
			public void onError(VKError error) {
				setIsLoading(false);
				if (mListener != null) {
					mListener.onVkShareError(error);
				}
			}
		});
	} else {
		makePostWithAttachments(null);
	}
}
 

开发者ID:DESTROYED,
项目名称:The_busy_calendar,
代码行数:27,
代码来源:VKShareDialogDelegate.java

示例2: uploadWallPhotoRequest

点赞 1

import com.vk.sdk.api.photo.VKUploadWallPhotoRequest; //导入依赖的package包/类
/**
 * Upload a specified file to VK servers for posting on user or group wall
 * @param image Image file to upload. Must have extension jpg or png
 * @param userId User wall id or 0
 * @param groupId Group id or 0
 * @return Prepared vk request for photo upload
 */
public static VKRequest uploadWallPhotoRequest(File image, long userId, int groupId) {
    return new VKUploadWallPhotoRequest(image, userId, groupId);
}
 

开发者ID:DESTROYED,
项目名称:The_busy_calendar,
代码行数:11,
代码来源:VKApi.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)