Is there any way to refresh fragment ListView in BroadcastReceiver when data received?
this is ListView's refresh method in Fragment extends ListFragment:
public void refreshTicketList() {
list = readData.getAllRows();
Collections.reverse(list);
if (list.isEmpty()) {
Toast.makeText(getContext(), "No data, Please Swipe Down to get data.", Toast.LENGTH_LONG).show();
} else {
adapter = new ListAdapter(getContext(), list);
setListAdapter(adapter);
}
}
how can i use this method in BroadcastReceiver?