I've stored ArrayList<Double>
on my bean class,
I've the bean class on my main activity,
How to pass the ArrayList<Double>
,from my main activity to another activity.?
My array list is double. how to pass double arraylist ?
This one helps you...
public Intent putParcelableArrayListExtra (String name, ArrayList<? extends Parcelable> value)
For more info look at putParcelableArrayListExtra
EDIT:
If you have a double[]
then you can use
void putDoubleArray(String key, double[] value)
of Bundle class..
Inserts a double array value into the mapping of this Bundle, replacing any existing value for the given key. And pass this bundle to Intent to Other Activity.
Update:2
FirstActivity:
Intent intent = new Intent(this, OtherActivity.class);
ArrayList<Double> listDouble = new ArrayList<Double>();
listDouble.add(1111.00000);
listDouble.add(13331.00000);
intent.putExtra("arraylist", listDouble);
startActivity(intent);
OtherActivity: (Retrieve Double ArrayList)
ArrayList<Double> listDouble = (ArrayList<Double>) getIntent().getSerializableExtra("arraylist");
System.out.println("...serialized data.." + listDouble);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With