Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Share an Arraylist between applications

Tags:

android

i have two applications which i want them to share the same arraylist.

how could i achive something like that? is there anything in Android for sharing such a prefrenceses?

thanks,

like image 424
Moshik Avatar asked Dec 08 '25 09:12

Moshik


1 Answers

When you pass between activities you can send info

Bundle bundle = new Bundle();
bundle.putStringArrayList("ArrayPics",myArrayofPics);         
Intent myIntent= new Intent(ActivityA.this, ActivityB.class);
myIntent.putExtras(bundle);
startActivity(myIntent);    

so your Activity B can receive the ArrayList

you can save data in Shared Preferences too and read in every Activity of your app

Shared Preferences

like image 58
Jorgesys Avatar answered Dec 10 '25 00:12

Jorgesys



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!