Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.news-service.com!xlned.com!feeder1.xlned.com!news.netcologne.de!newsfeed-fusi2.netcologne.de!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: Fri, 01 Apr 2011 00:38:09 +0100 Organization: Dirk Bruere at Neopax Lines: 61 Message-ID: <8vkhirFu2gU1@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> <8vk6gcFe5gU2@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 bILSngJFTFy/HgjoOX8WLg+vW0/4ZcbWS6x0WK3oqGVYwq57A1 Cancel-Lock: sha1:b/PsgTTK86mYplUcd1gptEcjkAU= 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: Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:2672 > Try to strip out everything you can and still reproduce the problem you > are asking about, and then paste into an article *exactly* the code for > which you want help. > > Patricia OK - here's the revision 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); ListView lvRadio = (ListView)findViewById(R.id.ListViewRadio); } ... } //Everything below is in a separate file public class BlinkAPI { private static Context mContext; static ListView radioLV; static ArrayList radioTitleArrayList = new ArrayList(); public BlinkAPI( Context ctx) { BlinkAPI.mContext = ctx; radioLV = (ListView )((Activity) mContext).findViewById(R.id.ListViewRadio); } private static void updateRadioTitles( ) { ArrayAdapter radioTitleAdapter = new ArrayAdapter(mContext, android.R.layout.simple_expandable_list_item_1,radioTitleArrayList); ...//Get titleStr etc radioTitleAdapter.add(titleStr); radioTitleAdapter.notifyDataSetChanged(); } } -- Dirk http://www.neopax.com/technomage/ - My new book - Magick and Technology