I have an Activity ItemList.java . When the user clicks on an item. This is the beginning of a new activity .let say ItemDetailAcitivty.java
What I want to do is when the user clicks the ItemDetailAcitivty.java button. He then had to tell ItemList.java update the list of items. I know that myListAdapter.notifyDataSetChanged() update the list. But how ItemList.java will know when to change data
I DONT for a static method or variables. I know how to use handlers, but I donβt know how to pass the handler to other actions.
What I think is to create my own Event / Listener and associate it with this list, so when the event fires, then change the list, most likely it could be a Broadcast receiver to help me?
source share