09-0806:59:36.6192009-2009/slimsimapps.troff D/AndroidRuntime﹕Shutting down VM
--------- beginning of crash
09-0806:59:36.6192009-2009/slimsimapps.troff E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: slimsimapps.troff, PID:2009
java.lang.IllegalStateException:Could not execute method for android:onClick
at android.view.View$DeclaredOnClickListener.onClick(View.java:4452)
at android.view.View.performClick(View.java:5198)
at android.view.View$PerformClick.run(View.java:21147)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(NativeMethod)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(NativeMethod)
at android.view.View$DeclaredOnClickListener.onClick(View.java:4447)
at android.view.View.performClick(View.java:5198)
at android.view.View$PerformClick.run(View.java:21147)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(NativeMethod)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)Caused by: java.lang.SecurityException:PermissionDenial: reading com.android.providers.media.MediaProvider uri content://media/external/audio/media from pid=2009, uid=10059 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
at android.os.Parcel.readException(Parcel.java:1599)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
at android.content.ContentProviderProxy.query(ContentProviderNative.java:421)
at android.content.ContentResolver.query(ContentResolver.java:491)
at android.content.ContentResolver.query(ContentResolver.java:434)
at slimsimapps.troff.MainActivity.initialize(MainActivity.java:106)
at slimsimapps.troff.MainActivity.InitializeExternal(MainActivity.java:80)
at java.lang.reflect.Method.invoke(NativeMethod)
at android.view.View$DeclaredOnClickListener.onClick(View.java:4447)
at android.view.View.performClick(View.java:5198)
at android.view.View$PerformClick.run(View.java:21147)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(NativeMethod)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)--------- beginning of system

if(checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE)!=PackageManager.PERMISSION_GRANTED){// Should we show an explanation?if(shouldShowRequestPermissionRationale(Manifest.permission.READ_EXTERNAL_STORAGE)){// Explain to the user why we need to read the contacts}
requestPermissions(newString[]{Manifest.permission.READ_EXTERNAL_STORAGE},
MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE);// MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE is an// app-defined int constant that should be quite uniquereturn;}

@TargetApi(23)void solicitarPermisos(){if(ContextCompat.checkSelfPermission(this,permiso)!=PackageManager.PERMISSION_GRANTED){// Should we show an explanation?if(shouldShowRequestPermissionRationale(Manifest.permission.READ_EXTERNAL_STORAGE)){// Explain to the user why we need to read the contacts}
requestPermissions(newString[]{Manifest.permission.READ_EXTERNAL_STORAGE},1);// MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE is an// app-defined int constant that should be quite uniquereturn;}}