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


Java Media.TITLE属性代码示例

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


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

示例1: buildImagesBucketList

private void buildImagesBucketList() {
	getThumbnail();
	mBucketList.clear();

	String columns[] = new String[] { Media._ID, Media.BUCKET_ID, Media.PICASA_ID, Media.DATA, Media.DISPLAY_NAME, Media.TITLE, Media.SIZE, Media.BUCKET_DISPLAY_NAME };
	Cursor cursor = contentResolver.query(Media.EXTERNAL_CONTENT_URI, columns, null, null, null);
	if (cursor.moveToFirst()) {
		int photoIDIndex = cursor.getColumnIndexOrThrow(Media._ID);
		int photoPathIndex = cursor.getColumnIndexOrThrow(Media.DATA);
		int bucketDisplayNameIndex = cursor.getColumnIndexOrThrow(Media.BUCKET_DISPLAY_NAME);
		int bucketIdIndex = cursor.getColumnIndexOrThrow(Media.BUCKET_ID);

		do {
			String _id = cursor.getString(photoIDIndex);
			String path = cursor.getString(photoPathIndex);
			String bucketName = cursor.getString(bucketDisplayNameIndex);
			String bucketId = cursor.getString(bucketIdIndex);

			ImageBucket bucket = mBucketList.get(bucketId);
			if (bucket == null) {
				bucket = new ImageBucket();
				mBucketList.put(bucketId, bucket);
				bucket.bucketList = new ArrayList<ImageItem>();
				bucket.bucketName = bucketName;
			}
			bucket.count++;
			ImageItem imageItem = new ImageItem();
			imageItem.setImageId(_id);
			imageItem.setImagePath(path);
			imageItem.setThumbnailPath(mThumbnailList.get(_id));
			bucket.bucketList.add(imageItem);

		} while (cursor.moveToNext());
	}
	hasBuildImagesBucketList = true;
}
 
开发者ID:Dreamer206602,项目名称:SimplifyReader2,代码行数:36,代码来源:ImagePickerHelper.java

示例2: getImageBucket

private void getImageBucket() {
	// 构造缩略图索引
	getThumbnail();
	// 构造相册索引
	String columns[] = new String[] { Media._ID, Media.BUCKET_ID, Media.PICASA_ID, Media.DATA, Media.DISPLAY_NAME, Media.TITLE, Media.SIZE, Media.BUCKET_DISPLAY_NAME };
	// 得到一个游标
	Cursor cur = cr.query(Media.EXTERNAL_CONTENT_URI, columns, null, null, "_id DESC");
	if (cur.moveToFirst()) {
		// 获取指定列的索引
		int photoIDIndex = cur.getColumnIndexOrThrow(Media._ID);
		int photoPathIndex = cur.getColumnIndexOrThrow(Media.DATA);
		int bucketDisplayNameIndex = cur.getColumnIndexOrThrow(Media.BUCKET_DISPLAY_NAME);
		int bucketIdIndex = cur.getColumnIndexOrThrow(Media.BUCKET_ID);
		do {
			String _id = cur.getString(photoIDIndex);
			String path = cur.getString(photoPathIndex);
			String bucketName = cur.getString(bucketDisplayNameIndex);
			String bucketId = cur.getString(bucketIdIndex);
			ImageBucket bucket = bucketList.get(bucketId);
			if (bucket == null) {
				bucket = new ImageBucket();
				bucketList.put(bucketId, bucket);
				bucket.imageList = new ArrayList<ImageItem>();
				bucket.bucketName = bucketName;
			}
			bucket.count++;
			ImageItem imageItem = new ImageItem();
			imageItem.imageId = _id;
			imageItem.imagePath = path;
			imageItem.thumbnailPath = thumbnailList.get(_id);
			imageItem.duration = "00:00";
			bucket.imageList.add(imageItem);
		} while (cur.moveToNext());
	}
}
 
开发者ID:do-android,项目名称:do_Album,代码行数:35,代码来源:AlbumHelper.java

示例3: buildImagesBucketList

public static HashMap<String, ImageBucket> buildImagesBucketList(Context context) {
    ContentResolver cr = context.getContentResolver();
    HashMap<String, ImageBucket> bucketList = new HashMap<String, ImageBucket>();

    // 构造缩略图索引
    HashMap<String, String> thumbnailList = getThumbnail(cr);

    // 构造相册索引
    String columns[] = new String[]{Media._ID, Media.BUCKET_ID,
            Media.PICASA_ID, Media.DATA, Media.DISPLAY_NAME, Media.TITLE,
            Media.SIZE, Media.BUCKET_DISPLAY_NAME};
    // 得到一个游标
    Cursor cur = cr.query(Media.EXTERNAL_CONTENT_URI, columns, null, null,
            null);
    if (cur.moveToFirst()) {
        // 获取指定列的索引
        int photoIDIndex = cur.getColumnIndexOrThrow(Media._ID);
        int photoPathIndex = cur.getColumnIndexOrThrow(Media.DATA);
        int bucketDisplayNameIndex = cur
                .getColumnIndexOrThrow(Media.BUCKET_DISPLAY_NAME);
        int bucketIdIndex = cur.getColumnIndexOrThrow(Media.BUCKET_ID);

        do {
            String _id = cur.getString(photoIDIndex);
            String path = cur.getString(photoPathIndex);
            String bucketName = cur.getString(bucketDisplayNameIndex);
            String bucketId = cur.getString(bucketIdIndex);

            ImageBucket bucket = bucketList.get(bucketId);
            if (bucket == null) {
                bucket = new ImageBucket();
                bucketList.put(bucketId, bucket);
                bucket.imageList = new ArrayList<ImageItem>();
                bucket.bucketName = bucketName;
            }
            bucket.count++;
            ImageItem imageItem = new ImageItem();
            imageItem.setImageId(_id);
            imageItem.setImagePath(path);
            imageItem.setThumbnailPath(thumbnailList.get(_id));
            bucket.imageList.add(imageItem);

        } while (cur.moveToNext());
    }
    cur.close();
    return bucketList;
}
 
开发者ID:gitxuyulin,项目名称:EditorImageAndText,代码行数:47,代码来源:ImagePathUtil.java

示例4: buildImageBucketList

public void buildImageBucketList(){
    //先获取缩略图索引
    getThumbnail();
    //查询获取相册索引
    String columns[] = new String[] {
            Media._ID,
            Media.BUCKET_ID,
            Media.PICASA_ID,
            Media.DATA,
            Media.DISPLAY_NAME,
            Media.TITLE,
            Media.SIZE,
            Media.BUCKET_DISPLAY_NAME };
    Cursor cursor = resolver.query(Media.EXTERNAL_CONTENT_URI, columns, null, null,
            Media._ID+" desc");
    if (cursor.moveToFirst()){
        // 获取指定列的索引
        int photoIDIndex = cursor.getColumnIndexOrThrow(Media._ID);
        int photoPathIndex = cursor.getColumnIndexOrThrow(Media.DATA);
        int photoNameIndex = cursor.getColumnIndexOrThrow(Media.DISPLAY_NAME);
        int photoTitleIndex = cursor.getColumnIndexOrThrow(Media.TITLE);
        int photoSizeIndex = cursor.getColumnIndexOrThrow(Media.SIZE);
        int bucketDisplayNameIndex = cursor
                .getColumnIndexOrThrow(Media.BUCKET_DISPLAY_NAME);
        int bucketIdIndex = cursor.getColumnIndexOrThrow(Media.BUCKET_ID);
        int picasaIdIndex = cursor.getColumnIndexOrThrow(Media.PICASA_ID);
        // 获取图片总数
        int totalNum = cursor.getCount();
        do {
            String _id = cursor.getString(photoIDIndex);
            String name = cursor.getString(photoNameIndex);
            String path = cursor.getString(photoPathIndex);
            String title = cursor.getString(photoTitleIndex);
            String size = cursor.getString(photoSizeIndex);
            String bucketName = cursor.getString(bucketDisplayNameIndex);
            String bucketId = cursor.getString(bucketIdIndex);
            String picasaId = cursor.getString(picasaIdIndex);

            ImageBucket bucket = bucketList.get(bucketId);
            if (bucket == null) {
                bucket = new ImageBucket();
                bucketList.put(bucketId, bucket);
                bucket.imageList = new ArrayList<>();
                bucket.bucketName = bucketName;
            }
            bucket.count++;
            ImageItem imageItem = new ImageItem();
            imageItem.imageId = _id;
            imageItem.imagePath = path;
            imageItem.thumbnailPath = thumbnailList.get(_id);
            bucket.imageList.add(imageItem);
        }while (cursor.moveToNext());

    }
    cursor.close();
    hasBuildImagesBucketList = true;
}
 
开发者ID:zillachan,项目名称:LibZilla,代码行数:57,代码来源:AlbumHelper.java


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