Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!newsfeed.neostrada.pl!unt-exc-01.news.neostrada.pl!news.onet.pl!.POSTED!not-for-mail From: Michal Kleczek Newsgroups: comp.lang.java.programmer Subject: Java OOP tutorial (Was: ArrayAdapter) Followup-To: comp.lang.java.programmer Date: Thu, 31 Mar 2011 13:52:19 +0200 Organization: http://onet.pl Lines: 67 Message-ID: References: <8vi26oFvh2U1@mid.individual.net> <8vj6efFla6U1@mid.individual.net> NNTP-Posting-Host: 77-252-124-164.ip.netia.com.pl Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Trace: news.onet.pl 1301572339 14239 77.252.124.164 (31 Mar 2011 11:52:19 GMT) X-Complaints-To: niusy@onet.pl NNTP-Posting-Date: Thu, 31 Mar 2011 11:52:19 +0000 (UTC) User-Agent: KNode/4.4.9 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:2644 Dirk Bruere at NeoPax wrote: > > 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); > > > lvVideo = (ListView)findViewById(R.id.ListViewVideo); > radioTitleAdapter = new > ArrayAdapter(this,android.R.layout.simple_expandable_list_item_1,BlinkAPI.videoArrayList); > lvVideo.setAdapter(radioTitleAdapter); > } > ... > } > > //******************************************* > public class BlinkAPI { > > private static Context mContext; > static ListView albumsLV, videoLV, tracksLV, artistsLV, radioLV; > > > public BlinkAPI( Context ctx) > { > BlinkAPI.mContext = ctx; > > radioLV = (ListView )((Activity) > mContext).findViewById(R.id.ListViewRadio); > > } > > private static void updateRadioTitles( ) { > > ... > radioTitleAdapter.add(titleStr); //PROBLEM > radioTitleAdapter.notifyDataSetChanged(); //PROBLEM > } > > How do I get at radioTitleAdapter? > There are so many issues with the code above that answering your direct question does not make sense IMHO (but surely someone is going to answer it and additionaly point out the issues). So in hope to be bright and suggest you to search Google for an OOP tutorial (possibly in Java) - I actually did: http://www.google.pl/search?q=java+object+oriented+programmin+tutorial And you know what - nothing really useful! A lot of material covering (somewhat like in an encyclopedia) what an object/class/instance variable/method is but nothing really _introductory_ that would illustrate "live objects communicating with each other to achieve a goal". Does anybody know of anything like this online? -- Michal