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: VideoPicker.java   Source Code and License Vote up 6 votes
@Override
public void bindView(View view, Context context, Cursor cursor) {
    ViewHolder vh = (ViewHolder) view.getTag();

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

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

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

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