![]() |
|
| 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 |
«
Tema Anterior
|
Siguiente tema
»
|
|
Herramientas |
|
#1
|
||||
|
||||
|
No funciona FileObserver
Hola estimada comunidad, intenté de muchas fomas y nunca llega a llamarse al metodo interno onEvent() pido un poco de su ayuda, gracias por su tiempo
Éste es el código [PHP]private void takePhoto(){ mPhotoResult = mFotoapparat.takePicture(); temporaryPath = Calendar.getInstance().getTime().getTime(); imagePath = new File(alphemsoftInkDirectory.getAbsolutePath(),temp oraryPath+".png" ); fileObs = new FileObserver(imagePath.getAbsolutePath()){ @override public void onEvent(int event, String path) { if (event == FileObserver.CREATE){ afterListener(); Toast.makeText(getActivity(),"Hi", Toast.LENGTH_LONG).show(); } } }; fileObs.startWatching(); storeImageLocations.add(imagePath.getAbsolutePath( )); if (!alphemsoftInkDirectory.exists()){ alphemsoftInkDirectory.mkdir(); } Toast.makeText(getActivity(),"Ready",Toast.LENGTH_ LONG).show(); try { imagePath.createNewFile(); } catch (IOException e) { e.printStackTrace(); Toast.makeText(getActivity(),imagePath.toString(), Toast.LENGTH_LONG); } mPhotoResult.saveToFile(imagePath); }[/PHP] |
|
|
| Respuesta |
Estás aquí
|
||||||
|
||||||
«
Tema Anterior
|
Siguiente tema
»
|
|
Hora actual: 12:00:25 (GMT +1)
HTCMania: líderes desde el 2007





