I need some help.
i've create a custom ArrayAdapter and override getView method like
this:
View v=convertView;
if(v==null){
LayoutInflater li = (LayoutInflater)
getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = li.inflate(R.layout.dynamic_element_layout, null);
}
In my dynamic_element_layout.xml i defined one table layout with 2
row. In the first row i have one TextView and i set the text for this
in my getView method(that works ok) the problem is that i want to
programmatically add an other control in my second table row
(EditText, Spinner, etc) and it's not working. I tried:
TableRow tr=(TableRow) v.findViewById(R.id.elementContainerTableRow);
if(tr!=null){
TextView tv=new TextView(getContext());
tv.setText("Text");
tv.setLayoutParams(new LayoutParams(
LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT));
tr.addView(tv);
}
Can somebody help me with this issue??
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en