问题描述
我正在构建一个警报应用程序.我目前有一个ListActivity,它显示警报列表,另一个活动是更改特定警报的时间.我的问题是,当我决定进入活动以更改警报时间,然后按后退"按钮时,它不会刷新.但是,我实现了一个按钮,该按钮可重定向回ListActivity,如果我按它,将刷新警报列表.按下后退按钮后,如何刷新警报列表?
I am building an alarm application. I currently have a ListActivity which display the list of alarms and another activity which changes the time of a particular alarm. My problem is, when I decide to enter into the activity to change the time of an alarm and then I press the back button, it does not refresh. However, I've implemented a button that redirects back to the ListActivity and if I press it, the list of alarms are refreshed. How can I, after pressing the back button, refresh the list of alarms?
推荐答案
您可能应该重写onResume()来检查警报列表是否已刷新,以便每当您进入或返回ListActivity时,它都会会得到更新.
You should probably override your onResume() to check if the list of alarms have been refreshed so that whenever you come to/come back to your ListActivity, it'll get updated.
这篇关于按下后退按钮后,如何刷新上一个活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!