当前位置: 首页>>代码示例>>Java>>正文


Java ImageColumns.BUCKET_ID属性代码示例

本文整理汇总了Java中android.provider.MediaStore.Images.ImageColumns.BUCKET_ID属性的典型用法代码示例。如果您正苦于以下问题:Java ImageColumns.BUCKET_ID属性的具体用法?Java ImageColumns.BUCKET_ID怎么用?Java ImageColumns.BUCKET_ID使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.provider.MediaStore.Images.ImageColumns的用法示例。


在下文中一共展示了ImageColumns.BUCKET_ID属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: LocalAlbum

public LocalAlbum(Path path, GalleryApp application, int bucketId,
        boolean isImage, String name) {
    super(path, nextVersionNumber());
    mApplication = application;
    mResolver = application.getContentResolver();
    mBucketId = bucketId;
    mName = name;
    mIsImage = isImage;

    if (isImage) {
        mWhereClause = ImageColumns.BUCKET_ID + " = ?";
        mOrderClause = ImageColumns.DATE_TAKEN + " DESC, "
                + ImageColumns._ID + " DESC";
        mBaseUri = Images.Media.EXTERNAL_CONTENT_URI;
        mProjection = LocalImage.PROJECTION;
        mItemPath = LocalImage.ITEM_PATH;
    } else {
        mWhereClause = VideoColumns.BUCKET_ID + " = ?";
        mOrderClause = VideoColumns.DATE_TAKEN + " DESC, "
                + VideoColumns._ID + " DESC";
        mBaseUri = Video.Media.EXTERNAL_CONTENT_URI;
        mProjection = LocalVideo.PROJECTION;
        mItemPath = LocalVideo.ITEM_PATH;
    }

    mNotifier = new ChangeNotifier(this, mBaseUri, application);
}
 
开发者ID:asm-products,项目名称:nexus-gallery,代码行数:27,代码来源:LocalAlbum.java

示例2: LocalAlbum

public LocalAlbum(Path path, MediaDataContext application, int bucketId,
                  boolean isImage, String name) {
    super(path, nextVersionNumber());
    mApplication = application;
    mResolver = application.getContentResolver();
    mBucketId = bucketId;
    mName = name;
    mIsImage = isImage;

    if (isImage) {
        mWhereClause = ImageColumns.BUCKET_ID + " = ?";
        mOrderClause = ImageColumns.DATE_TAKEN + " DESC, "
                + ImageColumns._ID + " DESC";
        mBaseUri = Images.Media.EXTERNAL_CONTENT_URI;
        mProjection = LocalImage.PROJECTION;
        mItemPath = LocalImage.ITEM_PATH;
    } else {
        mWhereClause = VideoColumns.BUCKET_ID + " = ?";
        mOrderClause = VideoColumns.DATE_TAKEN + " DESC, "
                + VideoColumns._ID + " DESC";
        mBaseUri = Video.Media.EXTERNAL_CONTENT_URI;
        mProjection = LocalVideo.PROJECTION;
        mItemPath = LocalVideo.ITEM_PATH;
    }

    mNotifier = new ChangeNotifier(this, mBaseUri, application);
}
 
开发者ID:mayurkaul,项目名称:medialibrary,代码行数:27,代码来源:LocalAlbum.java

示例3: LocalAlbum

public LocalAlbum(Path path, WoTuApp application, long bucketId,
        boolean isImage, String name) {
    super(path, nextVersionNumber());
    mApplication = application;
    mResolver = application.getContentResolver();
    mBucketId = bucketId;
    mName = getLocalizedName(application.getResources(), bucketId, name);
    mIsImage = isImage;

    if (isImage) {
        mWhereClause = ImageColumns.BUCKET_ID + " = ?";
        mOrderClause = ImageColumns.DATE_TAKEN + " DESC, "
                + ImageColumns._ID + " DESC";
        mBaseUri = Images.Media.EXTERNAL_CONTENT_URI;
        mProjection = LocalImage.PROJECTION;
        mItemPath = LocalImage.ITEM_PATH;
    } else {
        mWhereClause = VideoColumns.BUCKET_ID + " = ?";
        mOrderClause = VideoColumns.DATE_TAKEN + " DESC, "
                + VideoColumns._ID + " DESC";
        mBaseUri = Video.Media.EXTERNAL_CONTENT_URI;
        mProjection = LocalVideo.PROJECTION;
        mItemPath = LocalVideo.ITEM_PATH;
    }

    mNotifier = new DataNotifier(this, mBaseUri, application);
}
 
开发者ID:jituo666,项目名称:WoTu,代码行数:27,代码来源:LocalAlbum.java

示例4: handleImagePick

public static File handleImagePick(Context context, String prefKey, Intent data) {

		Uri selectedImage = data.getData();
		if (selectedImage != null) {
			String[] filePathColumn = { MediaColumns.DATA, ImageColumns.BUCKET_ID };

			Cursor cursor = context.getContentResolver().query(selectedImage, filePathColumn, null, null, null);

			if (cursor.moveToFirst()) {

				int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
				// int bucketIndex = cursor.getColumnIndex(filePathColumn[1]);
				String filePath = cursor.getString(columnIndex);
				// String bucketId = cursor.getString(bucketIndex);

				cursor.close();
				if (filePath != null) {
					File file = new File(filePath);
					if (file.exists()) {
						return file;
					}
				}
			}
		} else {
			Debug.e("Intent returned from image pick did not containt uri data:" + data);
		}
		return null;
	}
 
开发者ID:gandulf,项目名称:DsaTab,代码行数:28,代码来源:Util.java


注:本文中的android.provider.MediaStore.Images.ImageColumns.BUCKET_ID属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。