Example usage for android.database DatabaseUtils cursorIntToContentValues

List of usage examples for android.database DatabaseUtils cursorIntToContentValues

Introduction

In this page you can find the example usage for android.database DatabaseUtils cursorIntToContentValues.

Prototype

public static void cursorIntToContentValues(Cursor cursor, String field, ContentValues values, String key) 

Source Link

Document

Reads a Integer out of a field in a Cursor and writes it to a Map.

Usage

From source file:com.money.manager.ex.reports.PayeeReportFragment.java

private Payee getPayeeFromSelectedItem(ListView l, int position) {
    // Reading item from the list view, not adapter!
    Object item = l.getItemAtPosition(position);
    if (item == null)
        return null;

    Cursor cursor = (Cursor) item;
    Payee payee = new Payee();
    //        payee.loadFromCursor(cursor);
    // The fields are different! Can't use standard loadFromCursor.
    DatabaseUtils.cursorIntToContentValues(cursor, ViewMobileData.PAYEEID, payee.contentValues, Payee.PAYEEID);
    DatabaseUtils.cursorStringToContentValues(cursor, ViewMobileData.PAYEE, payee.contentValues,
            Payee.PAYEENAME);//from w  w w .j a  va 2  s. c o  m

    return payee;
}