You have to use * flat = getIntent().
getStringArrayListExtra("fromLat"); * to get the arraylist which has been
passed and not create a new Intent object to get the list.
*
*
*Cheers *
*Tarun*
*
*
*
*
On Mon, Apr 2, 2012 at 3:43 PM, Soyer <[email protected]> wrote:
> Sorry i don't know if i am getting you properly, but this one is
> different then the other, i found the method how to pass a list from
> one activity to another but still for some reason it's not being
> passed and it's returning null.
>
> Don't be so hasty to comment before understanding the thread
> properly !!!
>
> On Apr 2, 12:03 pm, Zsolt Vasvari <[email protected]> wrote:
> > Why spam the list with a new thread? Your previous one is just below.
> If
> > you do this, NOBODY is going to help you.
> >
> >
> >
> >
> >
> >
> >
> > On Monday, April 2, 2012 5:52:35 AM UTC+8, Soyer wrote:
> >
> > > Hello everyone,
> >
> > > i posted a question about passing a listview from one activity to
> > > another and this is what i did so far..
> >
> > > the first activity is this:
> >
> > > Bundle bundle = new Bundle(1);
> >
> > > bundle.putStringArrayList("fromLat", fromLat);
> >
> > > Intent intent1=new
> > > Intent(piecesActivity.this,ttsActivity.class);
> >
> > > intent1.putStringArrayListExtra("fromLat",
> > > fromLat);
> >
> > > startActivity(intent1);
> > > startActivityForResult(intent1, 2);
> >
> > > in The Second Activity is:
> >
> > > ArrayList <String>fLat = new ArrayList<String> ();
> >
> > > Intent intent=new Intent();
> > > fLat=intent.getStringArrayListExtra("fromLat");
> >
> > > System.out.println("=============================38"+fLat);
> >
> > > and in the second activity i am trying to make the list as a
> > > text_to_speach:
> >
> > > @Override
> > > public void onClick(View v) {
> >
> > > if (fLat!=null && ((CharSequence)
> fLat).length()>0)
> > > {
> > > Toast.makeText(ttsActivity.this, "Saying: " + fLat,
> > > Toast.LENGTH_LONG).show();
> > > tts.speak(fLat, TextToSpeech.QUEUE_ADD, null);
> > > }
> >
> > > i don't know why the second activity is giving me NullPointerException
> > > (the fLat is returning Null) and the .speak method is not accepting a
> > > list view... :S
> >
> > > I really need an advice...any Idea will be very appreciated.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en