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  
Viejo 06/09/17, 00:53:42
Avatar de LEAJIM_454
LEAJIM_454 LEAJIM_454 no está en línea
Miembro del foro
Mensajes: 215
 
Fecha de registro: nov 2012
Mensajes: 215
Modelo de smartphone: Galaxy Ace
Versión de ROM: 2.3.6 Stock
Tu operador: Otra
Mencionado: 1 comentarios
Tagged: 0 hilos
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]
Responder Con Cita


Respuesta

Estás aquí
Regresar   HTCMania > Todo sobre Android > Programación y Desarrollo para Android


Reglas de Mensajes
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Las caritas están On
Código [IMG] está On
Código HTML está Off

Saltar a Foro



Hora actual: 13:47:13 (GMT +1)

Cookies settings
Powered by vBulletin™
Copyright © vBulletin Solutions, Inc. All rights reserved.
 
HTCMania: líderes desde el 2007