Browse Source

oops

legacy v16.6-a7
Austin Huang 5 years ago
parent
commit
be45f52f7e
No known key found for this signature in database GPG Key ID: 84C23AA04587A91F
  1. 13
      app/src/main/java/awais/instagrabber/activities/ProfileViewer.java

13
app/src/main/java/awais/instagrabber/activities/ProfileViewer.java

@ -7,6 +7,7 @@ import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
@ -51,6 +52,7 @@ public final class ProfileViewer extends BaseLanguageActivity {
private FetchListener<String> fetchListener;
private boolean errorHandled = false;
private boolean fallbackToProfile = false;
private boolean destroyed = false;
@Override
protected void onCreate(@Nullable final Bundle savedInstanceState) {
@ -96,9 +98,9 @@ public final class ProfileViewer extends BaseLanguageActivity {
if (errorHandled && fallbackToProfile || Utils.isEmpty(profilePicUrl))
profilePicUrl = profileModel.getHdProfilePic();
final RequestManager glideRequestManager = Glide.with(this);
if (destroyed == true) return;
if (glideRequestManager == null) return;
final RequestManager glideRequestManager = Glide.with(this);
glideRequestManager.load(profilePicUrl).addListener(new RequestListener<Drawable>() {
@Override
@ -189,6 +191,13 @@ public final class ProfileViewer extends BaseLanguageActivity {
else if (error == 2) Toast.makeText(this, R.string.downloader_unknown_error, Toast.LENGTH_SHORT).show();
}
@Override
protected void onDestroy() {
super.onDestroy();
getDelegate().onDestroy();
destroyed = true;
}
@Override
public boolean onCreateOptionsMenu(final Menu menu) {
getMenuInflater().inflate(R.menu.menu, menu);

Loading…
Cancel
Save