Loop and ListView
- by monomi
I find a match with Regexp. How to correctly organize a loop, if more than one match and write it in the ListView?
listAlbums = (ListView)findViewById(R.id.listAlbums);
...
Pattern patternNameToId = Pattern.compile(kRegexp);
String nameTo = ""
Matcher matcherName = patternNameToId.matcher(response);
if (matcherName.find()) {
nameTo = matcherTopicTitle.group(2);
albumsList = new ArrayList<String>();
albumsList.add(nameTo);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(context,
android.R.layout.simple_list_item_1, albumsList);
listAlbums.setAdapter(adapter);
} else
Toast.makeText(context, "?? ???????", Toast.LENGTH_LONG).show();