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


Java VideoColumns._ID属性代码示例

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


在下文中一共展示了VideoColumns._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: getLatestMedia

private Media getLatestMedia(boolean video) {
	Media media = null;
	Uri baseUri = video ? Video.Media.EXTERNAL_CONTENT_URI
			: MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
	Uri query = baseUri.buildUpon().appendQueryParameter("limit", "1")
			.build();
	String[] projection = video ? new String[] { VideoColumns._ID,
			VideoColumns.DATE_TAKEN } : new String[] { ImageColumns._ID,
			ImageColumns.DATE_TAKEN, ImageColumns.ORIENTATION };
	String selection = video ? "" : ImageColumns.MIME_TYPE
			+ "='image/jpeg'";
	String order = video ? VideoColumns.DATE_TAKEN + " DESC,"
			+ VideoColumns._ID + " DESC" : ImageColumns.DATE_TAKEN
			+ " DESC," + ImageColumns._ID + " DESC";
	Cursor cursor = null;
	try {
		cursor = getContentResolver().query(query, projection, selection,
				null, order);
		if (cursor != null && cursor.moveToFirst()) {
			long id = cursor.getLong(0);
			long date = cursor.getLong(1);
			int orientation = video ? 0 : cursor.getInt(2);
			Uri uri = ContentUris.withAppendedId(baseUri, id);
			if (MyDebug.LOG)
				Log.d(TAG, "found most recent uri for "
						+ (video ? "video" : "images") + ": " + uri);
			media = new Media(id, video, uri, date, orientation);
		}
	} finally {
		if (cursor != null) {
			cursor.close();
		}
	}
	return media;
}
 
开发者ID:pov1912,项目名称:Selfie-Camera,代码行数:35,代码来源:MainActivity.java


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