當前位置: 首頁>>代碼示例>>Java>>正文


Java Cursor.deactivate方法代碼示例

本文整理匯總了Java中android.database.Cursor.deactivate方法的典型用法代碼示例。如果您正苦於以下問題:Java Cursor.deactivate方法的具體用法?Java Cursor.deactivate怎麽用?Java Cursor.deactivate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.database.Cursor的用法示例。


在下文中一共展示了Cursor.deactivate方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: deactivate

import android.database.Cursor; //導入方法依賴的package包/類
@Override
public void deactivate() {
    for (Cursor cursor : mCursors) {
        if (cursor != null) {
            cursor.deactivate();
        }
    }
}
 
開發者ID:philipwhiuk,項目名稱:q-mail,代碼行數:9,代碼來源:MergeCursor.java

示例2: getMinimumBrightness

import android.database.Cursor; //導入方法依賴的package包/類
public int getMinimumBrightness() {
  Cursor c = rDb.query(DbHelper.DB_TABLE_CALIBRATE,
      new String[] { DbHelper.CALIB_MIN_BRIGHT_COL }, null, null, null, null,
      null);
  c.moveToFirst();
  int b = c.getInt(c.getColumnIndexOrThrow(DbHelper.CALIB_MIN_BRIGHT_COL));
  c.deactivate();
  c.close();
  return b;
}
 
開發者ID:sdrausty,項目名稱:buildAPKsApps,代碼行數:11,代碼來源:DbAccessor.java

示例3: getType

import android.database.Cursor; //導入方法依賴的package包/類
@Override
public String getType(Uri url) {
    if (DBG) Log.d(TAG, "getType" + url);

    // determine match
    int match = URI_MATCHER.match(url);

    // let ScraperProvider handle what it can
    if (ScraperProvider.handles(match))
        return mScraperProvider.getType(url);

    // return what we can
    switch (match) {
        case VIDEO_MEDIA_ID:
        case FILES_ID:
            Cursor c = null;
            try {
                c = query(url, MIME_TYPE_PROJECTION, null, null, null);
                if (c != null && c.getCount() == 1) {
                    c.moveToFirst();
                    String mimeType = c.getString(1);
                    c.deactivate();
                    return mimeType;
                }
            } finally {
                if (c != null) {
                    c.close();
                }
            }
            break;

        case VIDEO_MEDIA:
            return Video.Media.CONTENT_TYPE;
    }
    throw new IllegalStateException("Unknown URL : " + url);
}
 
開發者ID:archos-sa,項目名稱:aos-MediaLib,代碼行數:37,代碼來源:VideoProvider.java

示例4: getType

import android.database.Cursor; //導入方法依賴的package包/類
@Override
public String getType(Uri url) {
    if (DBG) Log.d(TAG, "getType" + url);

    // determine match
    int match = URI_MATCHER.match(url);

    // return what we can
    switch (match) {
        case AUDIO_MEDIA_ID:
        case AUDIO_PLAYLISTS_ID_MEMBERS_ID:
        case FILES_ID:
            Cursor c = null;
            try {
                c = query(url, MIME_TYPE_PROJECTION, null, null, null);
                if (c != null && c.getCount() == 1) {
                    c.moveToFirst();
                    String mimeType = c.getString(1);
                    c.deactivate();
                    return mimeType;
                }
            } finally {
                if (c != null) {
                    c.close();
                }
            }
            break;

        case AUDIO_ALBUMART_ID:
            return "image/jpeg";

        case AUDIO_MEDIA:
        case AUDIO_GENRES_ID_MEMBERS:
        case AUDIO_PLAYLISTS_ID_MEMBERS:
            return Audio.Media.CONTENT_TYPE;

        case AUDIO_GENRES:
        case AUDIO_MEDIA_ID_GENRES:
            return Audio.Genres.CONTENT_TYPE;
        case AUDIO_GENRES_ID:
        case AUDIO_MEDIA_ID_GENRES_ID:
            return Audio.Genres.ENTRY_CONTENT_TYPE;
        case AUDIO_PLAYLISTS:
        case AUDIO_MEDIA_ID_PLAYLISTS:
            return Audio.Playlists.CONTENT_TYPE;
        case AUDIO_PLAYLISTS_ID:
        case AUDIO_MEDIA_ID_PLAYLISTS_ID:
            return Audio.Playlists.ENTRY_CONTENT_TYPE;
        case AUDIO_ALBUMS_ID:
            return Audio.Albums.CONTENT_TYPE;
        case AUDIO_ARTISTS_ID:
            return Audio.Artists.CONTENT_TYPE;
    }
    throw new IllegalArgumentException("Unsupported URI: " + url);
}
 
開發者ID:archos-sa,項目名稱:aos-MediaLib,代碼行數:56,代碼來源:MusicProvider.java


注:本文中的android.database.Cursor.deactivate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。