Reputation: 65
I have to consider saving the contents of an arraylist when navigating to an from the activity holding it and be able to add and delete. Any idea how to do this without making use of the database.
Upvotes: 0
Views: 158
Reputation: 681
If it is only a connection between 2 activities and not the whole app, I would consider to make use of an Intent.
You can put all kinds of extras to an Intent (also arrays) and connect the Intent to the startActivity(). In the new Activity you can unfold the extras and use them.
Upvotes: 1
Reputation: 1471
You can use shared preferences instead of database. In shared preferences, you can store data persistently as key-value pairs.
I strongly suggest you to read this (it's not too long): http://developer.android.com/guide/topics/data/data-storage.html
Upvotes: 1