0
Hello, I am still a baby in programming, I can not deny that I have advanced and vcs have helped, see well I have a listview with search, that the list comes from a string array, the code itself works perfect, but I’m trying to change the color of the text and the font to bold, from the list, and so I can do it with the code below, but in my onclick I have an "if" for each text clicked, some 8 texts, and so the problem onclick does not work when I change the color and font of the text, when there are these changes works normal. From now on, thank you all. The partegunta above where it says it is possibly duplicated has a completely diffident code! Follow part of my code:
lvbr = (ListView) findViewById(R.id.lvsbr);
etbr = (EditText) findViewById(R.id.etsr);
lst = getResources().getStringArray(R.array.sonsbr);
lvbr.setAdapter(new ArrayAdapter<String>(this, R.layout.seila, R.id.txtcor, lst));
CarregarEncontrados();
lvbr.setAdapter(new ArrayAdapter<String>(cardiobrasil.this, R.layout.seila, R.id.txtcor, lst_Encontrados));
}
});
lvbr.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View view, int position, long id) {
if (((TextView) view).getText().equals("Salto")) {
setContentView(R.layout.brc01);
Possible duplicate of Changing the Text Color of a listview?
– Junior Moreira
Thank you, the above subject is really similar, but I don’t use a pro Dapter class I did right there in the very own Activity class, beauty I can change the text color of the list items and the font type, but as I said I have an if in onclick for each text clicked, Then when the list is with the color and the font changed it doesn’t go where it should, or better simply doesn’t work. drew?
– wilfer