I want to have an access to another XML file in an inner class but I can’t get a reference to the other XML components, this an inner class code:
class ItemsClass extends ArrayAdapter<String>
{
public ItemsClass ()
{
super(ListActivity.this, R.layout.itemslist);
}
public View getView (final int position, View convertview, ViewGroup parent)
{
//setContentView(R.layout.itemslist);
final String s = this.getItem(position);
LayoutInflater inflater= getLayoutInflater();
View row= inflater.inflate(R.layout.itemslist, parent, false);
// get ref to each component in itemList.xml
TextView itemName= (TextView) row.findViewById(R.id.textView1);// here i can't access to the TextView in itemslist.xml
}
}
read this
http://www.vogella.de/articles/AndroidListView/article.html