|
||
|
![]() |
![]() |
Programación y Desarrollo para Android Subforo exclusivo para temas de programación de software para PDAs y desarrollo de aplicaciones, interfaces, etc bajo Android |
![]() |
|
Herramientas |
#1
|
||||
|
||||
error al actualizar a 4.4.2
Buenas, he actualizado mi tablet y la app que he desarrollado me da problema en una cosilla.
Mi app es de poner imagenes y guardarlas, y lo de guardar es lo que no funciona, antes funcionaba perfectamente, pero al actualizarla me ha dado errores. en concreto me da este error: Java.lang.IllegalStateException: Could not execute method of the activity. Y la linea de codigo en la que me da es esta: sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://"+ Environment.getExternalStorageDirectory()))); Alguien sabe lo que puede pasar? probe en otros dispositivos y funciona perfectamente. Muchas gracias! |
|
#2
|
||||
|
||||
Si pones todo el error. Tiene que poner en algún sitio. El nombre de la .class: y el número de linea.
Edito: puede ser por que te devuelva null en la dirección. Pon un try{}catch.. Y luego un log. De file
__________________
![]() Última edición por neoadn Día 17/12/13 a las 11:13:49. |
#3
|
||||
|
||||
Código:
try{ fos=new FileOutputStream(file); bmpBase.compress(Bitmap.CompressFormat.JPEG, 100, fos); sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://"+ Environment.getExternalStorageDirectory()))); fos.flush(); fos.close(); fos=null; if(guardarAlmacenamiento) Toast.makeText(getApplicationContext(), "Ya tienes tu imagen ", Toast.LENGTH_SHORT).show(); }catch(IOException e){ e.printStackTrace(); Toast.makeText(getApplicationContext(), "Error al guardar la imagen", Toast.LENGTH_SHORT).show(); } y este es el error entero 12-17 11:14:04.850: E/AndroidRuntime(5018): FATAL EXCEPTION: main 12-17 11:14:04.850: E/AndroidRuntime(5018): Process: com.comotu.collage.principal, PID: 5018 12-17 11:14:04.850: E/AndroidRuntime(5018): java.lang.IllegalStateException: Could not execute method of the activity 12-17 11:14:04.850: E/AndroidRuntime(5018): at android.view.View$1.onClick(View.java:3823) 12-17 11:14:04.850: E/AndroidRuntime(5018): at android.view.View.performClick(View.java:4438) 12-17 11:14:04.850: E/AndroidRuntime(5018): at android.view.View$PerformClick.run(View.java:18422 ) 12-17 11:14:04.850: E/AndroidRuntime(5018): at android.os.Handler.handleCallback(Handler.java:733 ) 12-17 11:14:04.850: E/AndroidRuntime(5018): at android.os.Handler.dispatchMessage(Handler.java:95 ) 12-17 11:14:04.850: E/AndroidRuntime(5018): at android.os.Looper.loop(Looper.java:136) 12-17 11:14:04.850: E/AndroidRuntime(5018): at android.app.ActivityThread.main(ActivityThread.jav a:5017) 12-17 11:14:04.850: E/AndroidRuntime(5018): at java.lang.reflect.Method.invokeNative(Native Method) 12-17 11:14:04.850: E/AndroidRuntime(5018): at java.lang.reflect.Method.invoke(Method.java:515) 12-17 11:14:04.850: E/AndroidRuntime(5018): at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:779) 12-17 11:14:04.850: E/AndroidRuntime(5018): at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:595) 12-17 11:14:04.850: E/AndroidRuntime(5018): at dalvik.system.NativeStart.main(Native Method) 12-17 11:14:04.850: E/AndroidRuntime(5018): Caused by: java.lang.reflect.InvocationTargetException 12-17 11:14:04.850: E/AndroidRuntime(5018): at java.lang.reflect.Method.invokeNative(Native Method) 12-17 11:14:04.850: E/AndroidRuntime(5018): at java.lang.reflect.Method.invoke(Method.java:515) 12-17 11:14:04.850: E/AndroidRuntime(5018): at android.view.View$1.onClick(View.java:3818) 12-17 11:14:04.850: E/AndroidRuntime(5018): ... 11 more 12-17 11:14:04.850: E/AndroidRuntime(5018): Caused by: java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.MEDIA_MOUNTED from pid=5018, uid=10105 12-17 11:14:04.850: E/AndroidRuntime(5018): at android.os.Parcel.readException(Parcel.java:1465) 12-17 11:14:04.850: E/AndroidRuntime(5018): at android.os.Parcel.readException(Parcel.java:1419) 12-17 11:14:04.850: E/AndroidRuntime(5018): at android.app.ActivityManagerProxy.broadcastIntent(A ctivityManagerNative.java:2373) 12-17 11:14:04.850: E/AndroidRuntime(5018): at android.app.ContextImpl.sendBroadcast(ContextImpl. java:1127) 12-17 11:14:04.850: E/AndroidRuntime(5018): at android.content.ContextWrapper.sendBroadcast(Conte xtWrapper.java:365) 12-17 11:14:04.850: E/AndroidRuntime(5018): at com.comotu.collage.principal.ActividadPrincipal.Gu ardarImagenParaProyecto(ActividadPrincipal.java:60 9) 12-17 11:14:04.850: E/AndroidRuntime(5018): at com.comotu.collage.principal.ActividadPrincipal.on ClickGuardarProyecto(ActividadPrincipal.java:537) 12-17 11:14:04.850: E/AndroidRuntime(5018): ... 14 more |
#4
|
||||
|
||||
Me da la sensación de que puede ser algo de permisos en el manifest
Perdona pero no estoy en casa... Mirate esto http://developer.android.com/guide/t...rmissions.html Este te puede ayudar en algo: http://www.vogella.com/articles/Andr...r/article.html
__________________
![]() Última edición por neoadn Día 17/12/13 a las 11:43:54. |
#5
|
||||
|
||||
Muchas gracias! voy a echarlo un vistazo y te comento
|
![]() |
![]() |
||||||
|