Return the string at the specified column of the cursor - Android Database

Android examples for Database:Cursor Column

Description

Return the string at the specified column of the cursor

Demo Code


import java.io.Closeable;
import java.io.IOException;
import android.database.Cursor;

public class Main{
    /** Return the string at the specified column of the cursor */
    public static String getString(Cursor cursor, DatabaseColumn column) {
        int index = cursor.getColumnIndex(column.getName());
        return (index != -1) ? cursor.getString(index) : "";
    }/*from w  w w  .  j a  v a 2  s .c  o m*/
}

Related Tutorials