Sunday, August 5, 2012

Re: [android-developers] camera and image intents problems

hi,

1.First you get the permission in manifest.xml for camera permission.
2.you have to use StartActivityForResult(intent,someconstantvalue);
3.You should match the resultcode == RESULT_OK in onActvitiyResult method.

you do above things , if any doubt feel free to reach me.

With regards,
Mani

On Fri, Aug 3, 2012 at 3:55 PM, Mark Murphy <mmurphy@commonsware.com> wrote:
On Fri, Aug 3, 2012 at 5:09 AM, Live Happy <livehappy7@gmail.com> wrote:
> 1. how can i show the default gallery application when using
> android.content.Intent.ACTION_GET_CONTENT, what i'm using now is to show a
> custom intent chooser with static package names
> (packageName.equals("com.google.android.gallery3d") ||
> packageName.equals("com.cooliris.media")
>                   || packageName.equals("com.htc.album") ||
> packageName.equals("com.sonyericsson.gallery"), surely there must be another
> way because i cannot possibly test on all phones

Please allow the *user* to choose where the *user* wants to get the
image from on the *user's* device with the *user's* installed apps.

>  2.i use this code :  Intent intent = new Intent();
>   intent.setAction(android.content.Intent.ACTION_VIEW);
>   intent.addCategory(android.content.Intent.CATEGORY_DEFAULT);
>   intent.setDataAndType(imageUri, "image/*"); to show a photo, but when i
> press back to return to my application it crashes, what is the problem?\

Use adb logcat, DDMS, or the LogCat view in Eclipse to examine LogCat
and look at the stack trace associated with your crash.

>  3. to capture a photo using the camera, i use the following code :
>  Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
>  intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
> but in onActivityResult in my activity when i click save, the data parameter
> is null, there is no uri of the image file, what am i doing wrong

You may not be doing anything wrong. The image should be at the
location you specified in file Uri.

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 4.0 Available!

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate