Re: ArrayAdapter
On 31/03/11 15:32, Dirk Bruere at NeoPax wrote:
On 31/03/2011 14:47, Nigel Wade wrote:
On 31/03/11 12:21, Dirk Bruere at NeoPax wrote:
private static void updateRadioTitles( ) {
...
radioTitleAdapter.add(titleStr); //PROBLEM
radioTitleAdapter.notifyDataSetChanged(); //PROBLEM
}
How do I get at radioTitleAdapter?
You ask whatever object knows where it is to let you have a copy of a
reference to it.
Since your code doesn't actually show that information I can't give
specific answers. But presumably some instance of class controller [sic]
knows where one can be found, since the onCreate() method of that class
creates one.
Yes -I have worked out that bit but do not know what it is,
What what is?
Some instance of the "controller" class is creating that ArrayAdaptor.
So that instance knows what it created. Ask that instance for a copy of
the reference to the ArrayAdaptor it created. Or get it to act as proxy
and do the work for you by adding a method to that class which performs
the necessary operations on its local copy of the reference.
esp since
other examples like ListView involve multiple casts
???
--
Nigel Wade