Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!news2.arglkargh.de!nuzba.szn.dk!pnx.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Dirk Bruere at NeoPax Newsgroups: comp.lang.java.programmer Subject: Re: ArrayAdapter Date: Thu, 31 Mar 2011 16:35:30 +0100 Organization: Dirk Bruere at Neopax Lines: 46 Message-ID: <8vjl9tFa13U1@mid.individual.net> References: <8vi26oFvh2U1@mid.individual.net> <8vj6efFla6U1@mid.individual.net> <8vjevuFn7mU1@mid.individual.net> <8vjhisFai4U1@mid.individual.net> <8vji5pFfcsU1@mid.individual.net> Reply-To: dirk.bruere@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net dLBuykP7ubmQBsjhSXNzPA+2zmspJGCEGyF6Wj/fz9Ld+PQMLL Cancel-Lock: sha1:bB8AKN7T1XxPKJJ8p+dWHxHGzQA= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 In-Reply-To: <8vji5pFfcsU1@mid.individual.net> Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:2658 On 31/03/2011 15:42, Nigel Wade wrote: > 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. I know - but I cannot find out how to do it! If I try to add this: ArrayAdapter getArrayAdapter(){ return radioTitleAdapter; } I get an error: "Syntax error on tokens, misplaced constructs". I don't have a clue what it means -- Dirk http://www.neopax.com/technomage/ - My new book - Magick and Technology