1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-11-22 06:37:30 +00:00
This commit is contained in:
Austin Huang 2020-07-20 12:12:38 -04:00
parent 63cbe6d201
commit be45f52f7e
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F

View File

@ -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);