android - Take picture with camera before starting new activity -


i have activity take picture upon touch of screen. after taking picture, i'd switch different activity. structure of code looks following:

class myactivity extends activity implements ontouchlistener {     ...     @override     public boolean ontouch(view v, motionevent event) {         mcameraview.takepicture();         // intent intent = new intent(whatever);         // startactivity(intent);         return false;     }    } 

as shown, if commented out startactivity, picture taken , saved correctly. if attempt start activity after taking picture, picture not saved correctly (size 0). don't know sure if picture taking in separate thread or not, if is, should eventually saved, doesn't appear case. idea how resolve this?

start activity @ end of camera.picturecallback()

mcameraview.takepicture(new camera.shuttercallback() {                      @override                     public void onshutter() {                         log.e("shutter closed", "   shutter    callback");                      }                 }, new camera.picturecallback() {                      @override                     public void onpicturetaken(byte[] arg0, camera arg1) {                         log.e("picture taken",                                 "   raw    image    callback");                     }                 }, new camera.picturecallback() {                      @override                     public void onpicturetaken(byte[] arg0, camera arg1) {                         log.e("picture taken",                                 "   postview    image    callback");                     }                 }, new camera.picturecallback() {                      @override                     public void onpicturetaken(byte[] data, camera camera) {                         // start activity here after saving image                     }                 });               }         }     }; 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -