Previous time I asked a question here I learned a lot so I guess it\'s worth a shot to try it again.
I am using the lazy list by Fedor from this link: Lazy load of i
Assume you have datasource Fruit contain few strings. You can define the onCreate() as following:
setListAdapter(new ArrayAdapter(this, R.layout.list_fruit,
FRUITS)); // context is this, style is list_fruit, Context, ,data_binding to FRUITs
And then write the onListItemClick() as following:
protected void onListItemClick(ListView parent, View v, int position, long id) {
Toast.makeText(this, " You selected " + FRUITS[position], Toast.LENGTH_SHORT).show();
}
I hope it works for you :)