How To Get A View Which Is Inside A Complex Listview Row View?
I have a ListView which has been populated by rows containing data using an adapter. The row layout is of 'RelativeLayout' type and contains various view objects, the id of one of
Solution 1:
overide this function in custom adapter.
public View getView(int position, View convertView, ViewGroup parent);
Viewv= convertView;
if (v == null) {
LayoutInflatervi= (LayoutInflater) c
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(id, null);
}
Now like if you want certain textview from the listview row item then do it like this:
TextViewt1= (TextView) v.findViewById(com.pis.prototype.R.id.TextView01);
t1 is your required view now...:P
Solution 2:
And if you want to get the already updated/created items in the list view and want to get some view from some row. Then do it like this..:
for (inti=0; i < yourCustomAdapter.size(); i++) {
ViewviewRow= listViewParts.getChildAt(i);
CheckBoxchkBox= (CheckBox) viewRow
.findViewById(R.id.checkBox);
yourCustomAdapter.get(i).attachmentCheck = chkBox
.isChecked();
}
In the above case I have extracted the checkbox views from the listview.
Post a Comment for "How To Get A View Which Is Inside A Complex Listview Row View?"