androNew
androNew

Reputation: 65

In android , how to save content of an arraylist

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

Answers (2)

user1014917
user1014917

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

Eren Tantekin
Eren Tantekin

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

Related Questions