Get database Column Value - Android Database

Android examples for Database:Cursor Get

Description

Get database Column Value

Demo Code


//package com.book2s;

import android.database.Cursor;

public class Main {
    public static String GetColumnValue(Cursor cur, String ColumnName) {
        try {//from   w  ww .j av a2  s.  c  o  m
            return cur.getString(cur.getColumnIndex(ColumnName));
        } catch (Exception ex) {
            return "";
        }
    }
}

Related Tutorials