Why not save the object to a global variable and access it in your next
activity? Something like
public class myArrayList extends Application{
private ArrayList<Whatever> myList;
public ArrayList<Whatever> getList(){
return myList;
}
public void setArrayList(ArrayList<Whatever> ArrayListFromActivity){
this.myList=ArrayListFromActivity;
}
}
((xmlName)this.getApplication()).getList(); and
((xmlName)this.getApplication()).setArrayList(yourArrayList);
hope this helps
you can set and get this by using:
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of sunita
Sent: Thursday, May 20, 2010 3:09 AM
To: Android Developers
Cc: [email protected]
Subject: [android-developers] Problem while passing aray list to next
activity in widget application
Hi all...
I am trying to create app widget.In this widget I have added one
image button.If i click on this button i should pass list of object to
next activity.Before passing this list to activity I am converting it
to parceable list and adding it to bunddle and puting that bundle to
intent.This logic is working fine in android 1.6, but this is not
working in Android 2.1.
In android 2.1. I am getting Null pointer excepion when I try to
access this list in next activity.
To solve this problem I tried to pass only String data through
bundle,in next activity String is displaying properly,but when I try
to pass list,then only i am not getting list in next activity.
Please give me suggestions for this problem.
--
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