Home | History | Annotate | Download | only in media

Lines Matching refs:Cursor

26 import android.database.Cursor;
49 * results into a single cursor. It also provides a {@link Ringtone} for each
210 * The column index (in the cursor returned by {@link #getCursor()} for the
216 * The column index (in the cursor returned by {@link #getCursor()} for the
222 * The column index (in the cursor returned by {@link #getCursor()} for the
230 private Cursor mCursor;
235 * If a column (item from this list) exists in the Cursor, its value must
245 * constructed instance manages cursor(s).
247 * @param activity The activity used to get a managed cursor.
257 * constructor will not manage the cursor(s), so the client should handle
260 * @param context The context to used to get a cursor.
364 * Returns a {@link Cursor} of all the ringtones available. The returned
365 * cursor will be the same cursor returned each time this method is called,
366 * so do not {@link Cursor#close()} the cursor. The cursor can be
367 * {@link Cursor#deactivate()} safely.
370 * caller should manage the returned cursor through its activity's life
371 * cycle to prevent leaking the cursor.
376 * @return A {@link Cursor} of all the ringtones available.
381 public Cursor getCursor() {
386 final Cursor internalCursor = getInternalRingtones();
387 final Cursor mediaCursor = getMediaRingtones();
389 return mCursor = new SortCursor(new Cursor[] { internalCursor, mediaCursor },
395 * {@link Cursor}.
397 * @param position The position (in the {@link Cursor}) of the ringtone.
410 * Gets a {@link Uri} for the ringtone at the given position in the {@link Cursor}.
412 * @param position The position (in the {@link Cursor}) of the ringtone.
416 // use cursor directly instead of requerying it, which could easily
425 private static Uri getUriFromCursor(Cursor cursor) {
426 return ContentUris.withAppendedId(Uri.parse(cursor.getString(URI_COLUMN_INDEX)), cursor
440 final Cursor cursor = getCursor();
441 final int cursorCount = cursor.getCount();
443 if (!cursor.moveToFirst()) {
451 String uriString = cursor.getString(URI_COLUMN_INDEX);
456 if (ringtoneUri.equals(ContentUris.withAppendedId(currentUri, cursor
461 cursor.move(1);
490 private static Uri getValidRingtoneUriFromCursorAndClose(Context context, Cursor cursor) {
491 if (cursor != null) {
494 if (cursor.moveToFirst()) {
495 uri = getUriFromCursor(cursor);
497 cursor.close();
505 private Cursor getInternalRingtones() {
512 private Cursor getMediaRingtones() {
519 // Get the external media cursor. First check to see if it is mounted.
577 private Cursor query(Uri uri,