I'm trying to add strings into a ListView, which gets called inside another ListView (changing the ContentView inside the OnItemClickListener )
Here's the code:
lv1.setOnItemClickListener(new OnItemClickListener(){
public void onItemClick(AdapterView<?> arg0, View arg1, int pos,
long arg3) {
// TODO Auto-generated method stub
if(lv1.getItemAtPosition(pos).equals(cat[0]))
{
setContentView(R.layout.browse_engineering);
final ListView engList = (ListView)findViewById(R.id.eng_list);
engList.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,eng_build));
}
}
});
And this is the error I get:

ArrayAdapterconstructor wants a Context as the first argument; Activities are Contexts. Since you're instantiating it inside anOnItemClickListener, thethiskeyword does not refer to the Activity. That needs to be fixed.