0
當數據收到時,有什麼辦法刷新BroadcastReceiver中的片段ListView?如何刷新BroadcastReceiver中的片段ListView?
這是在碎片ListView的刷新方法擴展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);
}
}
如何使用在廣播接收器這種方法嗎?
參考http://stackoverflow.com/questions/26163075/how-to -refresh-a-listview-from-a-broadcastreceiver – sasikumar
我無法理解它:( –