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


Java MediaColumns.DATE_ADDED属性代码示例

本文整理汇总了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;       
}
 
开发者ID:hubcarl,项目名称:mobile-manager-tool,代码行数:17,代码来源:RecentlyAddedFragment.java

示例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;       
}
 
开发者ID:cpoopc,项目名称:com.cp.monsterMod,代码行数:19,代码来源:RecentlyAddedFragment.java

示例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());
}
 
开发者ID:liufeiit,项目名称:itmarry,代码行数:18,代码来源:RecentlyAddedFragment.java

示例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;       
}
 
开发者ID:C-Aniruddh,项目名称:xPlodMusic,代码行数:17,代码来源:RecentlyAddedFragment.java


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