Hello,
I have a ListView that I want to use with an ArrayAdapter to add different styled rows. The rows are created on different states in my application, and depending on the different states the rows should be styled(like colors and stuff).
Here is some pseudo-code:
on creation:
mArrayAdapter = new ArrayAdapter(this, R.layout.message);
mView = (ListView) findViewById(R.id.in);
mView.setAdapter(mArrayAdapter);
On different states, which is triggered by another thread using a MessageHandler, add a row to the list containing a message:
mArrayAdapter.add("Message");
This works fine, messages are popping up in the list depending on different states, but I want to have the rows styled differently. How to do this? Is the solution to create a custom ArrayAdapter with a custom Add() method?
/James Ford