diff options
Diffstat (limited to 'OpenKeychain/src/main/java/org')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyShareFragment.java | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyShareFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyShareFragment.java index 4f66a7efc..4f64320ef 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyShareFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyShareFragment.java @@ -408,17 +408,20 @@ public class ViewKeyShareFragment extends LoaderFragment implements } protected void onPostExecute(Bitmap qrCode) { - mFingerprintQrCode.setImageBitmap(qrCode); - - // Transition drawable with a transparent drawable and the final bitmap - final TransitionDrawable td = - new TransitionDrawable(new Drawable[]{ - new ColorDrawable(Color.TRANSPARENT), - new BitmapDrawable(getResources(), qrCode) - }); - - mFingerprintQrCode.setImageDrawable(td); - td.startTransition(200); + // 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 + final TransitionDrawable td = + new TransitionDrawable(new Drawable[]{ + new ColorDrawable(Color.TRANSPARENT), + new BitmapDrawable(getResources(), qrCode) + }); + + mFingerprintQrCode.setImageDrawable(td); + td.startTransition(200); + } } }; |