本文整理匯總了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();
}
}
}
示例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;
}
示例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);
}
示例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);
}