Android examples for android.provider:BaseColumns
get Id Set from provider BaseColumns
//package com.java2s; import java.util.HashSet; import java.util.Set; import android.database.Cursor; import android.provider.BaseColumns; public class Main { public static Set<Long> getIdSet(Cursor c) { Set<Long> ids = new HashSet<Long>(); if (c.moveToFirst()) { do {/* w w w. j av a 2 s. co m*/ ids.add(c.getLong(c.getColumnIndex(BaseColumns._ID))); } while (c.moveToNext()); } return ids; } }