Obtenez tous les éléments à partir du curseur dans android

J'utilise ce code pour obtenir l'élément de curseur, mais il vient juste de retour d'un élément de ma liste. Alors, comment puis-je obtenir tous les éléments de ma liste, c'est mon code?

class MyAdapter extends SimpleCursorAdapter
{
private Context context;
public MyAdapter(Context context, int layout, Cursor c, String[] from, int[] to)
{
super(context, layout, c, from, to);
this.context = context;
}
public View getView(int position, View convertView, ViewGroup parent){
Cursor cursor = getCursor();
LayoutInflater inflater = ((Activity) context).getLayoutInflater();         
View v = inflater.inflate(R.layout.sbooks_row, null);           
TextView title = (TextView)findViewById(R.id.title);
if(title != null){
int index = cursor.getColumnIndex(SBooksDbAdapter.KEY_TITLE);
String type = cursor.getString(index);
title.setText(type);
}
TextView lyrics = (TextView)findViewById(R.id.lyrics);
if(lyrics != null){
int index = cursor.getColumnIndex(SBooksDbAdapter.KEY_LYRICS);
String type = cursor.getString(index);
lyrics.setText(type);
}
ImageView im = (ImageView)findViewById(R.id.icon);
if(im!=null){
int index = cursor.getColumnIndex(SBooksDbAdapter.KEY_FAVORITE);
int type = cursor.getInt(index);
if(type==1){
im.setImageResource(android.R.drawable.btn_star_big_on);
}
else{
im.setImageResource(android.R.drawable.btn_star_big_off);
}
}
return v;
}
InformationsquelleAutor Dennie | 2009-08-20