Android Camera App (picture only shows up after reboot) -


I'm having trouble with my camera app, I snap it a picture and then save it to the Android device's folder. I am trying and it is doing this, but pictures can only be shown after rebooting my device. In addition, I always end up with the result code of 0 0, so I never received my image to update. Why do I always get that result code?

  / ** To save an image, create a file * / Private static Yuri getOutputMediaFileUri () {return Uri.fromFile (getOutputMediaFile ()); } / ** Create a file to save an image * / personal static file getOutputMediaFile (file {file mediaStorageDir = new file (EnvironmentalGetEnsteenStorportport Directory (Environmental IDRECTORY_PICTURES), "myAppPics"); // Create a storage directory if it does not exist (MediaStorageDir.exists ()) {if (! MediaStorageDir.mkdirs ()) {Log D. ("MyAppPics", "Failed to Create Directory"); Return tap; }} // Create a Media File Name String Timestamp = New SimpleDateform ("yyyyMMdd_HHmmss"). Format (new date ()); File media file = new file (mediastogged.arapath () + file. Separator + "img _" + timestamp + ".jpg"); Return media file; } / ** Opening app * / open without public () {intent = new intent (android.provider.MediaStore.ACTION_IMAGE_CAPTURE_SECURE); FileUri = getOutputMediaFileUri (); // Image Intent. Create a file to save input Astra (MediaStore.xtra_uaptu, fileyurry); // image file name startActivityForResult set (Intention, 0); } @ Override / ** when you receive activity results * / protected void onActivityResult (int requestcode, integer result code, intent data) {// TODO auto generated method stub super.onActivityResult (requestCode, resultCode, data); // If you want to keep the picture (resultCode == RESULT_OK) {// Brad Image Data Bundle Extras = Data. Gatextros (); Bitmap bp = (bitmap) extras.jet ("data"); // Create Image View Image that is now myImgV.setImageBitmap (BP); Log D. ("MacMarify", "Update Image"); } // Just goes back to the previously selected image and log DD. ("MacArray", "do not want to update image" + result code);    

to see the picture

  refreshGallery (string File URL, reference CTX) {Intent MediaCententent = New Intent (Intent.action_midas_scns_signify); File f = new file (fileUrl); Uri content URI = Uri.framefile (f); MediaScanIntent.setData (contentUri); Ctx.sendBroadcast (mediaScanIntent); }    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -