/** * @param context The {@link Context} to use. * @param albumId The Id of the album the songs belong to. * @return The {@link Cursor} used to run the query. */ public static final Cursor makeAlbumSongCursor(final Context context, final Long albumId) { // Match the songs up with the artist final StringBuilder selection = new StringBuilder(); selection.append(AudioColumns.IS_MUSIC + "=1"); selection.append(" AND " + MediaColumns.TITLE + " != ''"); selection.append(" AND " + AudioColumns.ALBUM_ID + "=" + albumId); return context .getContentResolver() .query( MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, new String[] { /* 0 */ BaseColumns._ID, /* 1 */ MediaColumns.TITLE, /* 2 */ AudioColumns.ARTIST, /* 3 */ AudioColumns.ALBUM, /* 4 */ AudioColumns.DURATION }, selection.toString(), null, PreferenceUtils.getInstace(context).getAlbumSongSortOrder()); }
/** {@inheritDoc} */ @Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Fade it in overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out); // Get the preferences mPreferences = PreferenceUtils.getInstace(this); // Initialze the image cache mImageCache = ImageCache.getInstance(this); // UP getActionBar().setDisplayHomeAsUpEnabled(true); // Add the preferences addPreferencesFromResource(R.xml.settings); // Interface settings initInterface(); // Date settings initData(); // Removes the cache entries deleteCache(); // About showOpenSourceLicenses(); // Update the version number try { final PackageInfo packageInfo = getPackageManager().getPackageInfo(getPackageName(), 0); findPreference("version").setSummary(packageInfo.versionName); } catch (final NameNotFoundException e) { findPreference("version").setSummary("?"); } }
/** {@inheritDoc} */ @Override public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Get the preferences mPreferences = PreferenceUtils.getInstace(getActivity()); }