[android-developers] Re: Choosing an Image
You should be better off using the Constants values available. RESULT_OK or RESULT_CANCELLED. Just a suggestion. -Kumar Bibek http://tech-droid.blogspot.com On Jul 24, 9:34 am, KG wrote: > Never mind, I just realized that -1 is the correct value I want > > On Jul 23, 6:02 pm, KG wrote: > > > That gets me the Uri but still returns -1 as a resultCode. Do you > > have any idea why? > > > Also, I need to be able to take a picture via the Camera app. I can't > > test it on the emulator but I have this right now: > > > Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); > > startActivityForResult(cameraIntent, CAMERA_RESULT); > > > Does that look right? > > > On Jul 23, 5:52 pm, jeffro wrote: > > > > Try this instead: > > > > Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); > > > photoPickerIntent.setType("image/*"); > > > startActivityForResult(photoPickerIntent, 1); > > > > Jeff > > > Visit Trackaroo.com! > > > Trackmaster - Motorsports Lap Timer > > > Dynomaster - Performance Dyno > > > > On Jul 23, 4:44 pm, KG wrote: > > > > > Hi Everyone, > > > > > I'm trying to allow the user to choose an image to load into my app > > > > using the default image browser on the phone. > > > > Here is what I have so far: > > > > > Intent findImageIntent = new Intent(Intent.ACTION_GET_CONTENT); > > > > findImageIntent.setType("image/*"); > > > > startActivityForResult(Intent.createChooser(findImageIntent, "Select > > > > Picture"), IMAGE_SELECT); > > > > > This correctly launches the image chooser and I'm able to click one > > > > which returns me to my main activity. However, it does not load the > > > > image I selected, returning a -1 for resultCode in onActivityResult. > > > > > Anyone know what I'm doing wrong? > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Choosing an Image
Never mind, I just realized that -1 is the correct value I want On Jul 23, 6:02 pm, KG wrote: > That gets me the Uri but still returns -1 as a resultCode. Do you > have any idea why? > > Also, I need to be able to take a picture via the Camera app. I can't > test it on the emulator but I have this right now: > > Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); > startActivityForResult(cameraIntent, CAMERA_RESULT); > > Does that look right? > > On Jul 23, 5:52 pm, jeffro wrote: > > > Try this instead: > > > Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); > > photoPickerIntent.setType("image/*"); > > startActivityForResult(photoPickerIntent, 1); > > > Jeff > > Visit Trackaroo.com! > > Trackmaster - Motorsports Lap Timer > > Dynomaster - Performance Dyno > > > On Jul 23, 4:44 pm, KG wrote: > > > > Hi Everyone, > > > > I'm trying to allow the user to choose an image to load into my app > > > using the default image browser on the phone. > > > Here is what I have so far: > > > > Intent findImageIntent = new Intent(Intent.ACTION_GET_CONTENT); > > > findImageIntent.setType("image/*"); > > > startActivityForResult(Intent.createChooser(findImageIntent, "Select > > > Picture"), IMAGE_SELECT); > > > > This correctly launches the image chooser and I'm able to click one > > > which returns me to my main activity. However, it does not load the > > > image I selected, returning a -1 for resultCode in onActivityResult. > > > > Anyone know what I'm doing wrong? > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Choosing an Image
That gets me the Uri but still returns -1 as a resultCode. Do you have any idea why? Also, I need to be able to take a picture via the Camera app. I can't test it on the emulator but I have this right now: Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(cameraIntent, CAMERA_RESULT); Does that look right? On Jul 23, 5:52 pm, jeffro wrote: > Try this instead: > > Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); > photoPickerIntent.setType("image/*"); > startActivityForResult(photoPickerIntent, 1); > > Jeff > Visit Trackaroo.com! > Trackmaster - Motorsports Lap Timer > Dynomaster - Performance Dyno > > On Jul 23, 4:44 pm, KG wrote: > > > Hi Everyone, > > > I'm trying to allow the user to choose an image to load into my app > > using the default image browser on the phone. > > Here is what I have so far: > > > Intent findImageIntent = new Intent(Intent.ACTION_GET_CONTENT); > > findImageIntent.setType("image/*"); > > startActivityForResult(Intent.createChooser(findImageIntent, "Select > > Picture"), IMAGE_SELECT); > > > This correctly launches the image chooser and I'm able to click one > > which returns me to my main activity. However, it does not load the > > image I selected, returning a -1 for resultCode in onActivityResult. > > > Anyone know what I'm doing wrong? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Choosing an Image
That gets me the Uri but still returns -1 as a resultCode. Do you have any idea why? Also, I need to be able to take a picture via the Camera app. I can't test it on the emulator but I have this right now: Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(cameraIntent, CAMERA_RESULT); Does that look right? On Jul 23, 5:52 pm, jeffro wrote: > Try this instead: > > Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); > photoPickerIntent.setType("image/*"); > startActivityForResult(photoPickerIntent, 1); > > Jeff > Visit Trackaroo.com! > Trackmaster - Motorsports Lap Timer > Dynomaster - Performance Dyno > > On Jul 23, 4:44 pm, KG wrote: > > > Hi Everyone, > > > I'm trying to allow the user to choose an image to load into my app > > using the default image browser on the phone. > > Here is what I have so far: > > > Intent findImageIntent = new Intent(Intent.ACTION_GET_CONTENT); > > findImageIntent.setType("image/*"); > > startActivityForResult(Intent.createChooser(findImageIntent, "Select > > Picture"), IMAGE_SELECT); > > > This correctly launches the image chooser and I'm able to click one > > which returns me to my main activity. However, it does not load the > > image I selected, returning a -1 for resultCode in onActivityResult. > > > Anyone know what I'm doing wrong? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Choosing an Image
Try this instead: Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); photoPickerIntent.setType("image/*"); startActivityForResult(photoPickerIntent, 1); Jeff Visit Trackaroo.com! Trackmaster - Motorsports Lap Timer Dynomaster - Performance Dyno On Jul 23, 4:44 pm, KG wrote: > Hi Everyone, > > I'm trying to allow the user to choose an image to load into my app > using the default image browser on the phone. > Here is what I have so far: > > Intent findImageIntent = new Intent(Intent.ACTION_GET_CONTENT); > findImageIntent.setType("image/*"); > startActivityForResult(Intent.createChooser(findImageIntent, "Select > Picture"), IMAGE_SELECT); > > This correctly launches the image chooser and I'm able to click one > which returns me to my main activity. However, it does not load the > image I selected, returning a -1 for resultCode in onActivityResult. > > Anyone know what I'm doing wrong? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en