android-camera-intent

Trouble working with the camera in onActivityResult

老子叫甜甜 提交于 2019-11-26 14:16:58
问题 I have two options "select photo" and "take photo" - I have my select photo functionality fully working, but having problems with taking a photo. Mainly having the saved image display in my image view, after its been saved. Defined my photo location: public class photoActivity extends Activity { private String photoPath; private ImageView imgView; {...} My camera listener: bPicFromCam.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { String state = Environment

android camera : Failure delivering result ResultInfo{who=null, request=0, result=-1, data=null} to activity

自古美人都是妖i 提交于 2019-11-26 12:43:01
问题 i\'ve really frustased to solve my problem, i have an application that using camera, when camera capture a photo, it will display on activity, when i\'m not using cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, mPhotoUri); photo will display on activity, but the name and path file is not like what i wanted. i\'m using galaxy tab for compiling it, i have follow tutorial to solve my problem from here , here and here but my application still force close and eror, this is my code : { File sdCard=

java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1888, result=0, data=null} to activity

僤鯓⒐⒋嵵緔 提交于 2019-11-26 12:40:42
问题 My app allows the user to press a button, it opens the camera, they can take a photo and it will show up in an imageview. If the user presses back or cancel while the camera is open I get this force close - Failure delivering result ResultInfo{who=null, request=1888, result=0, data=null} to activity... so i am guessing the result=0 is the issue what would I need to insert to make this stop force closing? Below is my code. I know I am forgetting something but just cant figure it out!

Android startCamera gives me null Intent and … does it destroy my global variable?

邮差的信 提交于 2019-11-26 12:32:38
I have the next problem: when I try to start my camera, I can take the picture, even save it on my sdcard, but when I'm going to get the path for showing it on my device I get errors. My global variables are 2 (I used 1 but 2 are better for making sure it's a strange error): private File photofile; private Uri mMakePhotoUri; and this is my start-camera function: @SuppressLint("SimpleDateFormat") public void farefoto(int num){ // For naming the picture SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd_HHmmss"); String n = sdf.format(new Date()); String fotoname = "Immagine-"+ n +".jpg"; /

Stop saving photos using Android native camera

北城余情 提交于 2019-11-26 12:25:27
问题 I am using native Android camera and save file to my application data folder (/mnt/sdcard/Android/data/com.company.app/files/Pictures/). At the same time anther copy of photo is saved to DCIM folder. This is my code: Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); String formattedImageName = getDateString() + \".jpg\"; File image_file = new File(this.getExternalFilesDir(Environment.DIRECTORY_PICTURES), formattedImageName); Uri imageUri = Uri.fromFile(image_file); intent.putExtra

Android: Activity getting Destroyed after calling Camera Intent

自作多情 提交于 2019-11-26 11:46:20
I am having two Activities (A1 , A2). A1 calls A2 and from A2 i am calling the camera intent as below launchIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); launchIntent.putExtra(MediaStore.EXTRA_OUTPUT,photoPath); startActivityForResult(launchIntent,CAMERA_REQUEST); It opens the camera, and i can take the picture. But the Problem arises once i click the save button (tick button in s3), my onActivityResult is not called instead A2's onDestroy method is called. I have few logics to be done in the onActivityResult fn. I had read some post in Stackoverflow regarding this but

How to capture an image and store it with the native Android Camera

南笙酒味 提交于 2019-11-26 11:41:47
I am having a problem capturing an image and storing it from the native camera app. Here is a sample of some of my code. _path = Environment.getExternalStorageDirectory() + "make_machine_example.jpg"; File file = new File( _path ); Uri outputFileUri = Uri.fromFile( file ); Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE ); intent.putExtra( MediaStore.EXTRA_OUTPUT, outputFileUri ); startActivityForResult( intent, 0 ); After the picture has been taken and I'm returned back to my original Activity, When I navigate to my sd card via Android DDMS File Explorer the

Android: BroadcastReceiver intent to Detect Camera Photo Taken?

扶醉桌前 提交于 2019-11-26 11:04:27
问题 I\'m working on an Android application which needs to perform an action each time a new image is taken with the phone. I don\'t want to take the image within my application, but rather perform some action when the Camera app takes an image and saves it to the SD card. Right now, I\'ve gotten a BroadcastReceiver implemented that\'s currently listening for \"android.intent.action.CAMERA_BUTTON\". However, this doesn\'t seem to get called when I\'m wanting it to. I\'ve tried to debug the

Take a photo automatically without user interaction

江枫思渺然 提交于 2019-11-26 11:03:59
问题 I used this code to capture an image from the camera. package android.takeowneship; import java.io.File; import android.app.Activity; import android.content.ContentValues; import android.content.Intent; import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.net.Uri; import android.os.Bundle; import android.provider.MediaStore; import android.widget.ImageView; import android.widget.Toast; public class camera extends Activity{

Activity killed / onCreate called after taking picture via intent

ⅰ亾dé卋堺 提交于 2019-11-26 10:35:25
问题 I am trying to take a picture using an intent. My problem is that sometimes after taking a picture my activity, which calls startActivityForResult, seems to be destroyed so that onCreate is called again. Here is my code for taking pictures after clicking an imageview, which image should be replaced: if (!getPackageManager().hasSystemFeature( PackageManager.FEATURE_CAMERA)) { Util.makeLongToast(R.string.lang_no_camera); } else { Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);