Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.glorb.com!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 21:29:05 +0100 Organization: Dirk Bruere at Neopax Lines: 65 Message-ID: <8vk6gcFe5gU2@mid.individual.net> References: <8vi26oFvh2U1@mid.individual.net> <8vj6efFla6U1@mid.individual.net> <8vjevuFn7mU1@mid.individual.net> <8vjhisFai4U1@mid.individual.net> <8vji5pFfcsU1@mid.individual.net> <8vjl9tFa13U1@mid.individual.net> <8vk6c8Fe5gU1@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 p86Gy95+vbRc02C/Q43JXQpcxPO/o7nCCW9WIq+uybucF6Jutd Cancel-Lock: sha1:orPbSJfB/NVECSWMHbpHpR8fUM0= 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: <8vk6c8Fe5gU1@mid.individual.net> Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:2668 On 31/03/2011 21:26, Dirk Bruere at NeoPax wrote: > On 31/03/2011 18:09, Patricia Shanahan wrote: >> On 3/31/2011 8:35 AM, Dirk Bruere at NeoPax wrote: >> ... >>> I get an error: "Syntax error on tokens, misplaced constructs". >> >> It probably means that you put the construct somewhere where it is not >> permitted by the Java syntax. The actual issue, and what you need to do >> to fix it, depends on where you put it in your code. >> >> Patricia > > Let's start again with my latest code that also does not work To clarify a bit more public class controller extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Context currentContext = this; final BlinkAPI blinkAPI = new BlinkAPI(currentContext); lvRadio = (ListView)findViewById(R.id.ListViewRadio); } ... } //**************************************************************************** //Different file //**************************************************************************** public class BlinkAPI { private static Context mContext; static ListView radioLV; public BlinkAPI( Context ctx) { BlinkAPI.mContext = ctx; radioLV = (ListView )((Activity) mContext).findViewById(R.id.ListViewRadio); } private static void updateRadioTitles( ) { radioTitleAdapter = (ArrayAdapter) radioLV.getAdapter(); ...//Get titleStr etc radioTitleAdapter.add(titleStr); radioTitleAdapter.notifyDataSetChanged(); } This code crashes out -- Dirk http://www.neopax.com/technomage/ - My new book - Magick and Technology