Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #2673

Re: ArrayAdapter

From Dirk Bruere at NeoPax <dirk.bruere@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: ArrayAdapter
Date 2011-04-01 00:42 +0100
Organization Dirk Bruere at Neopax
Message-ID <8vkhrlFvkjU1@mid.individual.net> (permalink)
References (8 earlier) <WY-dnbKXTMWnKAnQnZ2dnUVZ_oKdnZ2d@earthlink.com> <8vk6c8Fe5gU1@mid.individual.net> <8vk6gcFe5gU2@mid.individual.net> <VJGdnQEu3fiDdAnQnZ2dnUVZ_gmdnZ2d@earthlink.com> <in2v3o$mea$1@dont-email.me>

Show all headers | View raw


On 31/03/2011 23:27, markspace wrote:
> On 3/31/2011 1:50 PM, Patricia Shanahan wrote:
>
>> Either you have serious problems with program structure that would
>> prevent compilation or you have problems pasting code into articles.
>
> I'm guessing this time it's the latter.
>
>  >>
>  >> This code crashes out
>
> This didn't end with a period which is uncharacteristic for the OP. I
> think his newsreader just failed, is all.
>
>
> To the OP: bits like these below:
>
>  >> ...//Get titleStr etc
>
>  >> lvRadio = (ListView)findViewById(R.id.ListViewRadio);
>  >> }
>  >> ...
>
> won't ever compile. Please remove the ...'s and post code that does
> compile, or at least shows what error with the compiler you are actually
> having.
>

Those dots are just all the other methods and code to generate titleStr.
The code I have just posted loads the title strings into the 
ArrayAdapter OK. The problem occurs HERE

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<String> radioTitleArrayList = new ArrayList<String>();

	
	
	public BlinkAPI( Context ctx)
	{
		BlinkAPI.mContext = ctx;
		radioLV = (ListView )((Activity) 
mContext).findViewById(R.id.ListViewRadio);
		
	}
	
	private static void updateRadioTitles( )
	{
     		ArrayAdapter<String> radioTitleAdapter = new 
ArrayAdapter<String>(mContext, 
android.R.layout.simple_expandable_list_item_1,radioTitleArrayList);
             String titleStr="hello";
             radioTitleAdapter.add(titleStr);
             radioLV.setAdapter(radioTitleAdapter); 	//HERE - the 
debugger splashes up "source not found"	
             radioTitleAdapter.notifyDataSetChanged();
     	}
}

-- 
Dirk

http://www.neopax.com/technomage/ - My new book - Magick and Technology

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

ArrayAdapter Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-03-31 02:03 +0100
  Re: ArrayAdapter Roedy Green <see_website@mindprod.com.invalid> - 2011-03-30 19:25 -0700
    Re: ArrayAdapter Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-03-30 19:42 -0700
      Re: ArrayAdapter Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-03-31 04:50 +0100
  Re: ArrayAdapter Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-03-31 16:02 +1300
  Re: ArrayAdapter Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-03-31 06:57 -0300
    Re: ArrayAdapter Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-03-31 10:19 +0000
      Re: ArrayAdapter Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-03-31 12:21 +0100
        Java OOP tutorial (Was: ArrayAdapter) Michal Kleczek <kleku75@gmail.com> - 2011-03-31 13:52 +0200
          Re: Java OOP tutorial (Was: ArrayAdapter) Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-03-31 13:16 +0100
          Re: Java OOP tutorial (Was: ArrayAdapter) "John B. Matthews" <nospam@nospam.invalid> - 2011-03-31 16:19 -0400
        Re: ArrayAdapter Nigel Wade <nmw-news@ion.le.ac.uk> - 2011-03-31 14:47 +0100
          Re: ArrayAdapter Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-03-31 15:32 +0100
            Re: ArrayAdapter Nigel Wade <nmw-news@ion.le.ac.uk> - 2011-03-31 15:42 +0100
              Re: ArrayAdapter Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-03-31 16:35 +0100
                Re: ArrayAdapter markspace <-@.> - 2011-03-31 09:56 -0700
                Re: ArrayAdapter Patricia Shanahan <pats@acm.org> - 2011-03-31 10:09 -0700
                Re: ArrayAdapter Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-03-31 21:26 +0100
                Re: ArrayAdapter Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-03-31 21:29 +0100
                Re: ArrayAdapter Patricia Shanahan <pats@acm.org> - 2011-03-31 13:50 -0700
                Re: ArrayAdapter markspace <-@.> - 2011-03-31 15:27 -0700
                Re: ArrayAdapter Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-01 00:42 +0100
                Re: ArrayAdapter Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-01 00:38 +0100
                Re: ArrayAdapter Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-04-01 13:08 +1300
                Re: ArrayAdapter Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-01 01:10 +0100
                Re: ArrayAdapter Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-04-01 13:45 +1300
        Re: ArrayAdapter Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-03-31 17:31 +0000
        Re: ArrayAdapter Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-04-01 13:06 +1300
          Re: ArrayAdapter Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-01 01:13 +0100
            Re: ArrayAdapter Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-04-01 13:35 +1300
  Re: ArrayAdapter Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-02 02:41 +0100
    Re: ArrayAdapter Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-04-02 04:19 +0200
      Re: ArrayAdapter Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-02 03:55 +0100
        Re: ArrayAdapter Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-04-02 17:12 +1300
          Re: ArrayAdapter Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-02 05:18 +0100
            Re: ArrayAdapter Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-04-02 19:58 +1300
              Re: ArrayAdapter Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-02 14:48 +0100
                Re: ArrayAdapter Lew <noone@lewscanon.com> - 2011-04-02 10:48 -0400
                Re: ArrayAdapter Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-04-03 10:50 +1200
                Re: ArrayAdapter Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-03 01:41 +0100
                Re: ArrayAdapter Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-04-03 12:53 +1200
                Re: ArrayAdapter Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-03 02:52 +0100
                Re: ArrayAdapter Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-04-03 19:56 +1200
                Re: ArrayAdapter Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-03 17:07 +0100
                Re: ArrayAdapter Dirk Bruere at NeoPax <dirk.bruere@gmail.com> - 2011-04-03 17:27 +0100
                Re: ArrayAdapter Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-04-04 10:19 +1200
                Re: ArrayAdapter Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-04-03 22:55 -0300

csiph-web