0

i am very confused about how i should implement the following in my android application. Let me explain the functionality that i want :

-i have a list view in my First Activity , say Activity A

-now , from this activity , i start another activity(activity B) with an intent for a result.

-with the result i get from the B, i want to update the listview in activity A.

-That is add an item in listview with the string returned.

i am thinking of, storing the items in array list and setting the array list to an array adapter to the listview.

now when the Activity B returns with a result i modify the arraylist and again set it to the listview. i want to know, is it possible?? and also i have a question : when does the activity B returns? so that in activity A's which methods(such as onResume(), onStart(), onRestart() ) should i write the logic for modifying the listview...? i am very new to android development

user2056245
  • 595
  • 1
  • 9
  • 24

1 Answers1

1

Regarding your first question, I think you are on right track. You can just add the returned string to an ArrayList and then to the ArrayAdapter.

For your second question, you will get a clear understanding how it works, by seeing the activity flow diagram here: http://developer.android.com/reference/android/app/Activity.html

Shobhit Puri
  • 25,769
  • 11
  • 95
  • 124