I have a list view with couple of items and i set this function get call when a row in the list view is clicked.
I want to open new activity and send him an object from an array of objects. I have a problem with this line :
Intent i = new Intent(this, Item_Activity.class);
because the this
is now no the activity.
this is the code:
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
Intent i = new Intent(this, Item_Activity.class);
Item item = m_items.get(position);
i.putExtra("object", item);
startActivity(i);
}
});