Possible Duplicate:
How to pass a value from one Activity to another in Android?
I have an activity with a list of titles and their bodies(content) (list6 example from ApiDemos). And I have an activity, where I add a note. When I click on “Add” button, I want the title of my note to appear on the list. Same with body. The problem is, that in List activity there are two String[] arrays with predefined hard-coded titles and bodies. What should I do to be able to add my own new titles with a content instead of having these hard-coded values?
I know I must use intents with startActivityForResult, but that’s probably all I know…
You have two option:
1) make the listview and the two arraylists static
This way you can use the same instances of it from the activity with add button and modify the listview as:
2)if you want to use intents:
while going to the ListActivity pass data by..
and to recover it in second activity use:
…and so on..