Search Results

Search found 2 results on 1 pages for 'josnidhin'.

Page 1/1 | 1 

  • Android Get Image Uri from Camera

    - by josnidhin
    Hi I have an application that calls the android phone's default camera to take photo the following is my code. Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(intent, TAKE_PICTURE); and in the onActivityResult method I am doing the following if ((requestCode == TAKE_PICTURE) && (resultCode == Activity.RESULT_OK)) { Uri photoPath = intent.getData(); // do something with the uri here } The above code works fine on htc Tatto and Sony ericsson's x10 running 1.6 but in on htc G1 running 1.6 the above code causes the following exception 03-08 18:54:25.906: ERROR/AndroidRuntime(4344): Uncaught handler: thread main exiting due to uncaught exception 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { act=inline-data (has extras) }} to activity removed java.lang.NullPointerException 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at android.app.ActivityThread.deliverResults(ActivityThread.java:3224) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3266) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at android.app.ActivityThread.access$2600(ActivityThread.java:116) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1823) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at android.os.Handler.dispatchMessage(Handler.java:99) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at android.os.Looper.loop(Looper.java:123) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at android.app.ActivityThread.main(ActivityThread.java:4203) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at java.lang.reflect.Method.invokeNative(Native Method) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at java.lang.reflect.Method.invoke(Method.java:521) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at dalvik.system.NativeStart.main(Native Method) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): Caused by: java.lang.NullPointerException 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at removed 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at android.app.Activity.dispatchActivityResult(Activity.java:3624) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): at android.app.ActivityThread.deliverResults(ActivityThread.java:3220) 03-08 18:54:25.966: ERROR/AndroidRuntime(4344): ... 11 more Any insights into how to solve this problem. Thank you.

    Read the article

  • Android Read contents of a URL (content missing after in result)

    - by josnidhin
    I have the following code that reads the content of a url public static String DownloadText(String url){ StringBuffer result = new StringBuffer(); try{ URL jsonUrl = new URL(url); InputStreamReader isr = new InputStreamReader(jsonUrl.openStream()); BufferedReader in = new BufferedReader(isr); String inputLine; while ((inputLine = in.readLine()) != null){ result.append(inputLine); } }catch(Exception ex){ result = new StringBuffer("TIMEOUT"); Log.e(Util.AppName, ex.toString()); } in.close(); isr.close(); return result.toString(); } The problem is I am missing content after 4065 characters in the result returned. Can someone help me solve this problem. Note: The url I am trying to read contains a json response so everything is in one line I think thats why I am having some content missing.

    Read the article

1