dinocore1/DevsmartLib-Android — comment on commit c44957ef81b87b2a41001db410edca4e04b531d3
File:  line 0
By vrash:

One more thing - I have changed the baseadapter to be a cursor adapter like so
// // ALternate for demo - Using DB
private CursorAdapter mAdapter = new CursorAdapter(mContext, mCursor) {

private OnClickListener mOnButtonClicked = new OnClickListener() {

@Override
public void onClick(View v) {
AlertDialog.Builder builder = new AlertDialog.Builder(
TOCRenderingActivity.this);
builder.setMessage("hello from " + v);
builder.setPositiveButton("Cool", null);
builder.show();

}
};

@Override
public View getView(int position, View convertView, ViewGroup parent) {

if (!mCursor.moveToPosition(position)) {
throw new IllegalStateException(
"couldn't move cursor to position " + position);
}
View v;
if (convertView == null) {
v = newView(mContext, mCursor, parent);
} else {
v = convertView;
}
bindView(v, mContext, mCursor);
return v;
}

@Override
public void bindView(View view, Context context, Cursor cursor) {
// TODO Auto-generated method stub
// TextView title = (TextView) retval.findViewById(R.id.toctitle);
Button button = (Button) view.findViewById(R.id.id_videobutton);
button.setText(cursor.getString(cursor.getColumnIndex("name")));
button.setOnClickListener(mOnButtonClicked);
// title.setText(getItem(position));

}

@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
View retval = LayoutInflater.from(parent.getContext()).inflate(
R.layout.viewvideoitem, null);
return retval;
}

};
}
Noob to Android - Can you please guide me to the changes I should make to the HorizontalListView.Java so I can read data from SQLITE. Thanks in advance!! Right now its not working with these changes. (non view holder)