There is option of capture image from camera in my application.But there is problem to get image from camera. When i use ACTION_IMAGE_CAPTURE
this it return null data.Please help me
get image path from camera intent
Error Log:
07-04 11:22:36.902: E/AndroidRuntime(8329): FATAL EXCEPTION: main
07-04 11:22:36.902: E/AndroidRuntime(8329): java.lang.RuntimeException: Unable to resume activity {com.pausefablogin/com.pausefablogin.AddPOI}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=111, result=-1, data=null} to activity {com.pausefablogin/com.pausefablogin.AddPOI}: java.lang.NullPointerException
07-04 11:22:36.902: E/AndroidRuntime(8329): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2124)
07-04 11:22:36.902: E/AndroidRuntime(8329): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2139)
07-04 11:22:36.902: E/AndroidRuntime(8329): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1672)
07-04 11:22:36.902: E/AndroidRuntime(8329): at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:2836)
07-04 11:22:36.902: E/AndroidRuntime(8329): at android.app.ActivityThread.access$1600(ActivityThread.java:117)
07-04 11:22:36.902: E/AndroidRuntime(8329): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939)
07-04 11:22:36.902: E/AndroidRuntime(8329): at android.os.Handler.dispatchMessage(Handler.java:99)
07-04 11:22:36.902: E/AndroidRuntime(8329): at android.os.Looper.loop(Looper.java:130)
07-04 11:22:36.902: E/AndroidRuntime(8329): at android.app.ActivityThread.main(ActivityThread.java:3687)
07-04 11:22:36.902: E/AndroidRuntime(8329): at java.lang.reflect.Method.invokeNative(Native Method)
07-04 11:22:36.902: E/AndroidRuntime(8329): at java.lang.reflect.Method.invoke(Method.java:507)
07-04 11:22:36.902: E/AndroidRuntime(8329): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
07-04 11:22:36.902: E/AndroidRuntime(8329): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
07-04 11:22:36.902: E/AndroidRuntime(8329): at dalvik.system.NativeStart.main(Native Method)
07-04 11:22:36.902: E/AndroidRuntime(8329): Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=111, result=-1, data=null} to activity {com.pausefablogin/com.pausefablogin.AddPOI}: java.lang.NullPointerException
07-04 11:22:36.902: E/AndroidRuntime(8329): at android.app.ActivityThread.deliverResults(ActivityThread.java:2536)
07-04 11:22:36.902: E/AndroidRuntime(8329): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2111)
07-04 11:22:36.902: E/AndroidRuntime(8329): ... 13 more
07-04 11:22:36.902: E/AndroidRuntime(8329): Caused by: java.lang.NullPointerException
07-04 11:22:36.902: E/AndroidRuntime(8329): at com.pausefablogin.AddPOI.onActivityResult(AddPOI.java:281)
07-04 11:22:36.902: E/AndroidRuntime(8329): at android.app.Activity.dispatchActivityResult(Activity.java:3908)
07-04 11:22:36.902: E/AndroidRuntime(8329): at android.app.ActivityThread.deliverResults(ActivityThread.java:2532)
07-04 11:22:36.902: E/AndroidRuntime(8329): ... 14 more
Thanks in advance
you can use following steps:
please declare permission and feature in your manifest file.
if u want in more detail then you can use following link:
http://developer.android.com/guide/topics/media/camera.html
i hope you will success.
try this one
and call this
and use the prrmission what you want
I had the same problem and the following worked for me:
Hope this helps as I know how frustrating it is.
when while loop doing the last itration it give the image path which in captured last time.
If you successfully implement the code you will get the image that is captured then manually you can save it for future use.
Make sure you have put this tag in your manifest file:
<uses-feature android:name="android.hardware.camera" />
And this might be help you: https://stackoverflow.com/a/10779050/2514032