Fix IllegalStateException in ViewKeyShareFragment
This commit is contained in:
@@ -408,17 +408,20 @@ public class ViewKeyShareFragment extends LoaderFragment implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void onPostExecute(Bitmap qrCode) {
|
protected void onPostExecute(Bitmap qrCode) {
|
||||||
mFingerprintQrCode.setImageBitmap(qrCode);
|
// only change view, if fragment is attached to activity
|
||||||
|
if (ViewKeyShareFragment.this.isAdded()) {
|
||||||
|
mFingerprintQrCode.setImageBitmap(qrCode);
|
||||||
|
|
||||||
// Transition drawable with a transparent drawable and the final bitmap
|
// Transition drawable with a transparent drawable and the final bitmap
|
||||||
final TransitionDrawable td =
|
final TransitionDrawable td =
|
||||||
new TransitionDrawable(new Drawable[]{
|
new TransitionDrawable(new Drawable[]{
|
||||||
new ColorDrawable(Color.TRANSPARENT),
|
new ColorDrawable(Color.TRANSPARENT),
|
||||||
new BitmapDrawable(getResources(), qrCode)
|
new BitmapDrawable(getResources(), qrCode)
|
||||||
});
|
});
|
||||||
|
|
||||||
mFingerprintQrCode.setImageDrawable(td);
|
mFingerprintQrCode.setImageDrawable(td);
|
||||||
td.startTransition(200);
|
td.startTransition(200);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user