mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2025-01-22 23:00:56 +01:00
Fixed: BadTokenException in OnlineFeedView
This commit is contained in:
parent
b261de232f
commit
1e28ad36df
@ -61,6 +61,8 @@ public abstract class OnlineFeedViewActivity extends ActionBarActivity {
|
||||
private Map<String, String> alternateFeedUrls;
|
||||
private Downloader downloader;
|
||||
|
||||
private boolean isPaused;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
setTheme(UserPreferences.getTheme());
|
||||
@ -96,6 +98,18 @@ public abstract class OnlineFeedViewActivity extends ActionBarActivity {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
isPaused = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
isPaused = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
@ -126,9 +140,11 @@ public abstract class OnlineFeedViewActivity extends ActionBarActivity {
|
||||
if (status.isSuccessful()) {
|
||||
parseFeed();
|
||||
} else if (status.getReason() == DownloadError.ERROR_UNAUTHORIZED) {
|
||||
if (!isFinishing() && !isPaused) {
|
||||
Dialog dialog = new FeedViewAuthenticationDialog(OnlineFeedViewActivity.this,
|
||||
R.string.authentication_notification_title, downloader.getDownloadRequest().getSource());
|
||||
dialog.show();
|
||||
}
|
||||
} else {
|
||||
String errorMsg = status.getReason().getErrorString(
|
||||
OnlineFeedViewActivity.this);
|
||||
@ -276,6 +292,7 @@ public abstract class OnlineFeedViewActivity extends ActionBarActivity {
|
||||
}
|
||||
|
||||
private void showErrorDialog(String errorMsg) {
|
||||
if (!isFinishing() && !isPaused) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.error_label);
|
||||
if (errorMsg != null) {
|
||||
@ -299,9 +316,6 @@ public abstract class OnlineFeedViewActivity extends ActionBarActivity {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
if (!isFinishing()) {
|
||||
builder.show();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user