Excepción createChooser de puntero nulo

Uri selectedUri = Uri.fromFile(selected.getAbsoluteFile()); String fileExtension = MimeTypeMap.getFileExtensionFromUrl(selectedUri.toString()); String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(fileExtension); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(selectedUri, mimeType); Intent chooser = Intent.createChooser(intent, "Open File..."); startActivity(chooser); 

Este código utilizado para trabajar siempre, lo que significa que incluso si no se encontraron actividades para manejar la intención, diálogo selector todavía aparecería indicando tal. Ahora este código arroja una NullPointerException (versión 4.3) si no hay actividades encontradas para rellenar el diálogo selector. ¿Alguien más ha experimentado esto o sabe algo que puede estar haciendo mal?

Logcat:

 02-25 17:03:24.260: E/AndroidRuntime(13502): FATAL EXCEPTION: main 02-25 17:03:24.260: E/AndroidRuntime(13502): java.lang.RuntimeException: Unable to start activity ComponentInfo{android/com.android.internal.app.ChooserActivity}: java.lang.NullPointerException 02-25 17:03:24.260: E/AndroidRuntime(13502): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2517) 02-25 17:03:24.260: E/AndroidRuntime(13502): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2574) 02-25 17:03:24.260: E/AndroidRuntime(13502): at android.app.ActivityThread.access$600(ActivityThread.java:162) 02-25 17:03:24.260: E/AndroidRuntime(13502): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1413) 02-25 17:03:24.260: E/AndroidRuntime(13502): at android.os.Handler.dispatchMessage(Handler.java:99) 02-25 17:03:24.260: E/AndroidRuntime(13502): at android.os.Looper.loop(Looper.java:158) 02-25 17:03:24.260: E/AndroidRuntime(13502): at android.app.ActivityThread.main(ActivityThread.java:5789) 02-25 17:03:24.260: E/AndroidRuntime(13502): at java.lang.reflect.Method.invokeNative(Native Method) 02-25 17:03:24.260: E/AndroidRuntime(13502): at java.lang.reflect.Method.invoke(Method.java:525) 02-25 17:03:24.260: E/AndroidRuntime(13502): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027) 02-25 17:03:24.260: E/AndroidRuntime(13502): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:843) 02-25 17:03:24.260: E/AndroidRuntime(13502): at dalvik.system.NativeStart.main(Native Method) 02-25 17:03:24.260: E/AndroidRuntime(13502): Caused by: java.lang.NullPointerException 02-25 17:03:24.260: E/AndroidRuntime(13502): at com.android.internal.app.ResolverActivity.checkListHeight(ResolverActivity.java:299) 02-25 17:03:24.260: E/AndroidRuntime(13502): at com.android.internal.app.ResolverActivity.onCreate(ResolverActivity.java:219) 02-25 17:03:24.260: E/AndroidRuntime(13502): at com.android.internal.app.ChooserActivity.onCreate(ChooserActivity.java:53) 02-25 17:03:24.260: E/AndroidRuntime(13502): at android.app.Activity.performCreate(Activity.java:5195) 02-25 17:03:24.260: E/AndroidRuntime(13502): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1111) 02-25 17:03:24.260: E/AndroidRuntime(13502): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2473) 02-25 17:03:24.260: E/AndroidRuntime(13502): ... 11 more 

FlipAndroid es un fan de Google para Android, Todo sobre Android Phones, Android Wear, Android Dev y Aplicaciones para Android Aplicaciones.