OSDN Git Service

Fix a problem with the "scanning card" dialog popping up when quickly
[android-x86/packages-apps-Music.git] / src / com / android / music / MusicUtils.java
index 2262d03..ed9a3bf 100644 (file)
@@ -600,6 +600,13 @@ public class MusicUtils {
     private static String mLastSdStatus;
 
     public static void displayDatabaseError(Activity a) {
+        if (a.isFinishing()) {
+            // When switching tabs really fast, we can end up with a null
+            // cursor (not sure why), which will bring us here.
+            // Don't bother showing an error message in that case.
+            return;
+        }
+
         String status = Environment.getExternalStorageState();
         int title = R.string.sdcard_error_title;
         int message = R.string.sdcard_error_message;