Java Code Examples for android.database.Cursor.copyStringToBuffer()

The following are Jave code examples for showing how to use copyStringToBuffer() of the android.database.Cursor class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: aos-Video   File:   Source Code and License Vote up 6 votes
public void bindView(View view, Context context, Cursor cursor) {
    ViewHolder vh = (ViewHolder) view.getTag();

    cursor.copyStringToBuffer(mVideoIdx, vh.buffer1);
    vh.line1.setText(, 0, vh.buffer1.sizeCopied);

    vh.duration.setText(Utils.makeDurationString(context, cursor.getInt(mDurationIdx), false));

    final StringBuilder builder = mBuilder;
    builder.delete(0, builder.length());

    String name = cursor.getString(mVideoIdx);
    if (name == null || name.equals("<unknown>")) {
    } else {
    int len = builder.length();
    builder.getChars(0, len, vh.buffer2, 0);
    vh.line2.setText(vh.buffer2, 0, len);