diff options
author | Owen Lin <owenlin@google.com> | 2012-04-05 12:02:01 +0800 |
---|---|---|
committer | Owen Lin <owenlin@google.com> | 2012-04-05 12:04:24 +0800 |
commit | 13e61e48a4eb7e09bdcb84fac0b15c33b5970599 (patch) | |
tree | a72cd55b5ec823ac0c53dd6511a838655e523dfe /src/com/android/gallery3d/app/AlbumPage.java | |
parent | f9a737de45b0d9ef5bb3355bb2e79dd1d0402d5c (diff) | |
download | android_packages_apps_Snap-13e61e48a4eb7e09bdcb84fac0b15c33b5970599.tar.gz android_packages_apps_Snap-13e61e48a4eb7e09bdcb84fac0b15c33b5970599.tar.bz2 android_packages_apps_Snap-13e61e48a4eb7e09bdcb84fac0b15c33b5970599.zip |
Fix NPE in Gallery.
bug: 6249248
Change-Id: I41851c6524163195f6296a15893d962e706b3449
Diffstat (limited to 'src/com/android/gallery3d/app/AlbumPage.java')
-rw-r--r-- | src/com/android/gallery3d/app/AlbumPage.java | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/com/android/gallery3d/app/AlbumPage.java b/src/com/android/gallery3d/app/AlbumPage.java index e0b738444..3d8c86d4b 100644 --- a/src/com/android/gallery3d/app/AlbumPage.java +++ b/src/com/android/gallery3d/app/AlbumPage.java @@ -45,6 +45,7 @@ import com.android.gallery3d.ui.AlbumView; import com.android.gallery3d.ui.DetailsHelper; import com.android.gallery3d.ui.DetailsHelper.CloseListener; import com.android.gallery3d.ui.GLCanvas; +import com.android.gallery3d.ui.GLRoot; import com.android.gallery3d.ui.GLView; import com.android.gallery3d.ui.GridDrawer; import com.android.gallery3d.ui.HighlightDrawer; @@ -561,13 +562,19 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster ((Activity) mActivity).runOnUiThread(new Runnable() { @Override public void run() { - if (resultCode == MediaSet.SYNC_RESULT_SUCCESS) { - mInitialSynced = true; - } - clearLoadingBit(BIT_LOADING_SYNC); - if (resultCode == MediaSet.SYNC_RESULT_ERROR && mIsActive) { - Toast.makeText((Context) mActivity, R.string.sync_album_error, - Toast.LENGTH_LONG).show(); + GLRoot root = mActivity.getGLRoot(); + root.lockRenderThread(); + try { + if (resultCode == MediaSet.SYNC_RESULT_SUCCESS) { + mInitialSynced = true; + } + clearLoadingBit(BIT_LOADING_SYNC); + if (resultCode == MediaSet.SYNC_RESULT_ERROR && mIsActive) { + Toast.makeText((Context) mActivity, R.string.sync_album_error, + Toast.LENGTH_LONG).show(); + } + } finally { + root.unlockRenderThread(); } } }); |