refresh setting summary after download
This commit is contained in:
parent
8706cb6aa7
commit
865c9668a1
1 changed files with 5 additions and 4 deletions
|
@ -98,12 +98,11 @@ public class SettingsDevelopmentActivity extends SettingsBaseActivity {
|
|||
//pref.setEnabled(false);
|
||||
cat.addPreference(pref);
|
||||
|
||||
long agpsLastDownloaded = settings.AGPS_DATA_LAST_TIME_DOWNLOADED.get();
|
||||
pref = new Preference(this);
|
||||
pref.setTitle(R.string.agps_info);
|
||||
if (agpsLastDownloaded != 0L) {
|
||||
if (settings.AGPS_DATA_LAST_TIME_DOWNLOADED.get() != 0L) {
|
||||
SimpleDateFormat prt = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
pref.setSummary(getString(R.string.agps_data_last_downloaded, prt.format(agpsLastDownloaded)));
|
||||
pref.setSummary(getString(R.string.agps_data_last_downloaded, prt.format(settings.AGPS_DATA_LAST_TIME_DOWNLOADED.get())));
|
||||
} else {
|
||||
pref.setSummary(getString(R.string.agps_data_last_downloaded, "--"));
|
||||
}
|
||||
|
@ -117,6 +116,8 @@ public class SettingsDevelopmentActivity extends SettingsBaseActivity {
|
|||
getMyApplication().getLocationProvider().redownloadAGPS();
|
||||
if(getMyApplication().getLocationProvider().agpsDownloaded() == true) {
|
||||
getMyApplication().getSettings().AGPS_DATA_LAST_TIME_DOWNLOADED.set(System.currentTimeMillis());
|
||||
SimpleDateFormat prt = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
pref.setSummary(getString(R.string.agps_data_last_downloaded, prt.format(settings.AGPS_DATA_LAST_TIME_DOWNLOADED.get())));
|
||||
//for debugging only: try catch issue here where A-GPS data sometimes seems destroyed but not reloaded
|
||||
//} else {
|
||||
// getMyApplication().getSettings().AGPS_DATA_LAST_TIME_DOWNLOADED.set(0L);
|
||||
|
|
Loading…
Reference in a new issue