Android : Refresh Activity List in Android?

on Saturday, March 21, 2015


I am a newbie to Android and I would like to know how to go about passing object back and forth between activities. I have the following scenario:



Activity A { ArraryList<Employee> ..}
Activity B
Activity C

i.putExtra("employee", empObject);
startActivity(A, C.Class); //In A: A->C

i.putExtra("employee", empObject);
startActivity(C, B.Class); //In C: C->B

i.putExtra("employee", empObject);
startActivity(B, A.Class); //In B: B->A


Basically, I pass employee object to other Activities (B & C ) in this case, do some stuff and go back to original List in "A". I want the original list to refresh when I go back to it.

- Do I implement this list as an ObservableList?
- Is it correct to startActivity to go back to previous Activity, I know I could use ActivityResult, but in this case I want to go from A->C, C->B, then B->A as opposed to A->B and then B->A?


Thanks


0 comments:

Post a Comment