I´m using a cursor adapter and I want to set text on a textview subtracting the current row with the previous row of the listview, my code :
public class CustomCursorAdapter extends CursorAdapter {
@SuppressWarnings("deprecation")
public CustomCursorAdapter(Context context, Cursor c) {
super(context, c);
this.c = c;
}
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
// when the view will be created for first time,
// we need to tell the adapters, how each item will look
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
View retView = inflater.inflate(R.layout.list_row_main, parent, false);
return retView;
}
@Override
public void bindView(View view, Context context, Cursor cursor) {
double weight = cursor.getDouble(cursor
.getColumnIndex(DbHelper.ENTRY_USER_WEIGHT));
}
}
0 comments:
Post a Comment