0
How do I get the line id of a listview? The idea is this: before picking up the selected line, I’ll work with all the lines I’m trying.
aList = new ArrayList<HashMap<String,String>>();
for(int i=0;i<countries.length;i++){
HashMap<String, String> hm = new HashMap<String,String>();
hm.put("txt", getString(countries[i]));
aList.add(hm);
}
String[] from = { "txt" };
int[] to = { R.id.txt};
SimpleAdapter adapter = new SimpleAdapter(getActivity().getBaseContext(), aList, R.layout.listview_layout, from, to);
setListAdapter(adapter);
...
OnItemClickListener listener = new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, final int arg2, long arg3) {
for(int i=0;i< arg0.getCount();i++){
não sei fazer o setText(); em todos os 'R.id.txt'...
}
If anyone has an idea how to do I appreciate the help.
Thank you for your reply @Juarez. I forgot to mention that I am using a layout in the listview that has a Textview with id 'txt' and it is in it that I want to set the text.
– Emerson Barcellos
I assume you’ve created an Itemlistview class and an Adapter class that extends from Basedapter, is that it? but still it will be almost the same logic of this example that I did
– Skywalker
if yes, enter the code of those classes in the question.
– Skywalker
Okay! Reworked question.
– Emerson Barcellos