Android examples for android.database:Cursor
long From Cursor
import android.database.Cursor; public class Main{ static long longFromCursor(Cursor c) { long id = -1; if (c != null) { c.moveToFirst();//from w w w .j a va 2s . c o m if (!c.isAfterLast()) { id = c.getLong(0); } } c.close(); return id; } }