本文整理汇总了Java中android.provider.MediaStore.MediaColumns.DATE_ADDED属性的典型用法代码示例。如果您正苦于以下问题:Java MediaColumns.DATE_ADDED属性的具体用法?Java MediaColumns.DATE_ADDED怎么用?Java MediaColumns.DATE_ADDED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.provider.MediaStore.MediaColumns
的用法示例。
在下文中一共展示了MediaColumns.DATE_ADDED属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupFragmentData
public void setupFragmentData(){
mAdapter = new RecentlyAddedAdapter(getActivity(), R.layout.music_listview_items,
null, new String[] {}, new int[] {}, 0);
mProjection = new String[] {
BaseColumns._ID, MediaColumns.TITLE, AudioColumns.ALBUM, AudioColumns.ARTIST
};
StringBuilder where = new StringBuilder();
int X = MusicUtils.getIntPref(getActivity(), NUMWEEKS, 5) * 3600 * 24 * 7;
where.append(MediaColumns.TITLE + " != ''");
where.append(" AND " + AudioColumns.IS_MUSIC + "=1");
where.append(" AND " + MediaColumns.DATE_ADDED + ">"
+ (System.currentTimeMillis() / 1000 - X));
mWhere = where.toString();
mSortOrder = MediaColumns.DATE_ADDED + " DESC";
mUri = Audio.Media.EXTERNAL_CONTENT_URI;
mTitleColumn = MediaColumns.TITLE;
}
示例2: setupFragmentData
public void setupFragmentData(){
mAdapter = new RecentlyAddedAdapter(getActivity(), R.layout.listview_items,
null, new String[] {}, new int[] {}, 0);
//构造查询语句,父类中回调,给cursorloader使用
mProjection = new String[] {
BaseColumns._ID, MediaColumns.TITLE, AudioColumns.ALBUM, AudioColumns.ARTIST
};
StringBuilder where = new StringBuilder();
int X = MusicUtils.getIntPref(getActivity(), NUMWEEKS, 5) * 3600 * 24 * 7;
where.append(MediaColumns.TITLE + " != ''");
where.append(" AND " + AudioColumns.IS_MUSIC + "=1");
where.append(" AND " + MediaColumns.DATE_ADDED + ">"
+ (System.currentTimeMillis() / 1000 - X));
mWhere = where.toString();
mSortOrder = MediaColumns.DATE_ADDED + " DESC";
//查询音乐的uri?
mUri = Audio.Media.EXTERNAL_CONTENT_URI;
mTitleColumn = MediaColumns.TITLE;
}
示例3: onCreateLoader
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
String[] projection = new String[] {
BaseColumns._ID, MediaColumns.TITLE, AudioColumns.ALBUM, AudioColumns.ARTIST
};
StringBuilder where = new StringBuilder();
String sortOrder = MediaColumns.DATE_ADDED + " DESC";
Uri uri = Audio.Media.EXTERNAL_CONTENT_URI;
int X = MusicUtils.getIntPref(getActivity(), NUMWEEKS, 5) * 3600 * 24 * 7;
where = new StringBuilder();
where.append(MediaColumns.TITLE + " != ''");
where.append(" AND " + AudioColumns.IS_MUSIC + "=1");
where.append(" AND " + MediaColumns.DATE_ADDED + ">"
+ (System.currentTimeMillis() / 1000 - X));
return new AddIdCursorLoader(getActivity(), uri, projection, where.toString(), null, sortOrder);
//return new RecentlyAddedLoader(getActivity());
}
示例4: setupFragmentData
public void setupFragmentData(){
mAdapter = new RecentlyAddedAdapter(getActivity(), R.layout.listview_items,
null, new String[] {}, new int[] {}, 0);
mProjection = new String[] {
BaseColumns._ID, MediaColumns.TITLE, AudioColumns.ALBUM, AudioColumns.ARTIST
};
StringBuilder where = new StringBuilder();
int X = MusicUtils.getIntPref(getActivity(), NUMWEEKS, 5) * 3600 * 24 * 7;
where.append(MediaColumns.TITLE + " != ''");
where.append(" AND " + AudioColumns.IS_MUSIC + "=1");
where.append(" AND " + MediaColumns.DATE_ADDED + ">"
+ (System.currentTimeMillis() / 1000 - X));
mWhere = where.toString();
mSortOrder = MediaColumns.DATE_ADDED + " DESC";
mUri = Audio.Media.EXTERNAL_CONTENT_URI;
mTitleColumn = MediaColumns.TITLE;
}