java - Monitoring a folder Eclipse -


i'm making app can take photos. if taken photo saved folder want toaster message appear.

however current code when click camera button, toaster comes without waiting photo taken.

below source code take photo:

static final int request_image_capture = 1; private static final int capture_image_activity_request_code = 0; public void onclickbtncamera(view v){   intent imageintent = new intent(android.provider.mediastore.action_image_capture);   string timestamp = new simpledateformat("yyyymmdd_hhmmss").format(new date());   uri urisavedimage=uri.fromfile(     new  file("/storage/emulated/0/dcim/camera","qr_"+timestamp+ ".png"));   imageintent.putextra(mediastore.extra_output, urisavedimage);   startactivityforresult(imageintent, 1); } 

the toaster want show:

toast toast= toast.maketext(getapplicationcontext(),              "picture taking", toast.length_short); toast.setgravity(gravity.top|gravity.center_horizontal, 100, 0); toast.show(); 

can tell me why code failing intended job?

@craig question you've asked isn't clear/complete.

assuming information have provided, want message displayed on screen once picture saved. , using

imageintent.putextra(mediastore.extra_output, urisavedimage); 

have event listener on imageintent object. register event method contains piece of code.

toast toast= toast.maketext(getapplicationcontext(),                 "picture taking", toast.length_short);         toast.setgravity(gravity.top|gravity.center_horizontal, 100, 0);         toast.show(); 

ps: might not actual solution hope should give direction


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -