@@ -129,7 +129,7 @@ public void onCreate(Bundle savedInstanceState) {
129
129
Log .d (TAG , "onCreate() intent=" + getIntent ().toString ());
130
130
setCache ();
131
131
getHsList ();
132
- showHsInfo (getIntent ());
132
+ showHsInfo (getIntent (), true );
133
133
} else {
134
134
showError (getString (R .string .error_title ) + getString (R .string .error_network_title ),
135
135
getString (R .string .error_network_msg ));
@@ -140,7 +140,7 @@ public void onCreate(Bundle savedInstanceState) {
140
140
@ UiThread
141
141
protected void onNewIntent (Intent intent ) {
142
142
Log .d (TAG , "onNewIntent()=" + intent );
143
- showHsInfo (intent );
143
+ showHsInfo (intent , false );
144
144
}
145
145
146
146
@ Override
@@ -170,7 +170,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
170
170
final int id = item .getItemId ();
171
171
if (id == R .id .menu_refresh ) {
172
172
if (hasNetwork ()) {
173
- showHsInfo (getIntent ());
173
+ showHsInfo (getIntent (), true );
174
174
} else {
175
175
showError (getString (R .string .error_title ) + getString (R .string .error_network_title ),
176
176
getString (R .string .error_network_msg ));
@@ -339,7 +339,7 @@ private void getHsList() {
339
339
/**
340
340
* Fetch the endpoint and update the `mApiUrl` and `mResultHs` variables.
341
341
*/
342
- private void showHsInfo (@ Nullable Intent intent ) {
342
+ private void showHsInfo (@ Nullable Intent intent , boolean skipCache ) {
343
343
final Bundle data = (Bundle ) getLastNonConfigurationInstance ();
344
344
345
345
// Get space endpoint URL
@@ -368,7 +368,7 @@ private void showHsInfo(@Nullable Intent intent) {
368
368
finishApi = true ;
369
369
mResultHs = (HashMap <String , String >) data .getSerializable (STATE_HS );
370
370
populateDataHs ();
371
- } else if (mResultHs .containsKey (mApiUrl )) {
371
+ } else if (mResultHs .containsKey (mApiUrl ) && ! skipCache ) {
372
372
Log .d (TAG , "showHsInfo(data from cache)" );
373
373
finishApi = true ;
374
374
populateDataHs ();
@@ -512,7 +512,7 @@ protected void onPostExecute(String result) {
512
512
dismissLoading ();
513
513
if (mErrorMsg == null ) {
514
514
mResultHs .put (mUrl , result );
515
- showHsInfo (getIntent ());
515
+ showHsInfo (getIntent (), false );
516
516
} else {
517
517
setViewVisibility (false );
518
518
showError (mErrorTitle , mErrorMsg );
0 commit comments