Note that there are some explanatory texts on larger screens.

plurals
  1. POTaking the image from sd card
    primarykey
    data
    text
    <p>When I am taking the image from sd card its working fine in my mobile (micromax canvas hd), but its not working in galaxy nexus. In galaxy nexus its showing the null pointer exception.</p> <pre><code> if (requestCode == GALLERY_PICTURE) { if (resultCode == RESULT_OK) { if (data != null) { // our BitmapDrawable for the thumbnail BitmapDrawable bmpDrawable = null; // try to retrieve the image using the data from the intent Cursor cursor = getContentResolver().query(data.getData(), null, null, null, null); if (cursor != null) { cursor.moveToFirst(); Uri selectedImageUri = data.getData(); selectedImagePath = getPath(selectedImageUri); Log.d("file path","file path name"+selectedImagePath); int idx = cursor.getColumnIndex(ImageColumns.DATA); String fileSrc = cursor.getString(idx); bitmap = BitmapFactory.decodeFile(fileSrc); // load // preview // image bitmap = Bitmap.createScaledBitmap(bitmap, 100, 100, false); // bmpDrawable = new BitmapDrawable(bitmapPreview); image.setImageBitmap(bitmap); data1 = null; </code></pre> <p>this is log file---</p> <pre><code> 12-30 14:37:26.480: E/CursorWindow(14558): Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 6 columns. 12-30 14:37:26.490: E/AndroidRuntime(14558): FATAL EXCEPTION: main 12-30 14:37:26.490: E/AndroidRuntime(14558): Process: com.app.postevery, PID: 14558 12-30 14:37:26.490: E/AndroidRuntime(14558): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { dat=content://com.android.providers.media.documents/document/image:30713 flg=0x1 }} to activity {com.app.postevery/com.app.postevery.PostEvery}: java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it. 12-30 14:37:26.490: E/AndroidRuntime(14558): at android.app.ActivityThread.deliverResults(ActivityThread.java:3365) 12-30 14:37:26.490: E/AndroidRuntime(14558): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3408) 12-30 14:37:26.490: E/AndroidRuntime(14558): at android.app.ActivityThread.access$1300(ActivityThread.java:135) 12-30 14:37:26.490: E/AndroidRuntime(14558): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244) 12-30 14:37:26.490: E/AndroidRuntime(14558): at android.os.Handler.dispatchMessage(Handler.java:102) 12-30 14:37:26.490: E/AndroidRuntime(14558): at android.os.Looper.loop(Looper.java:136) 12-30 14:37:26.490: E/AndroidRuntime(14558): at android.app.ActivityThread.main(ActivityThread.java:5017) 12-30 14:37:26.490: E/AndroidRuntime(14558): at java.lang.reflect.Method.invokeNative(Native Method) 12-30 14:37:26.490: E/AndroidRuntime(14558): at java.lang.reflect.Method.invoke(Method.java:515) 12-30 14:37:26.490: E/AndroidRuntime(14558): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 12-30 14:37:26.490: E/AndroidRuntime(14558): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 12-30 14:37:26.490: E/AndroidRuntime(14558): at dalvik.system.NativeStart.main(Native Method) 12-30 14:37:26.490: E/AndroidRuntime(14558): Caused by: java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it. 12-30 14:37:26.490: E/AndroidRuntime(14558): at android.database.CursorWindow.nativeGetString(Native Method) 12-30 14:37:26.490: E/AndroidRuntime(14558): at android.database.CursorWindow.getString(CursorWindow.java:434) 12-30 14:37:26.490: E/AndroidRuntime(14558): at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:51) 12-30 14:37:26.490: E/AndroidRuntime(14558): at android.database.CursorWrapper.getString(CursorWrapper.java:114) 12-30 14:37:26.490: E/AndroidRuntime(14558): at com.app.postevery.PostEvery.onActivityResult(PostEvery.java:548) 12-30 14:37:26.490: E/AndroidRuntime(14558): at android.app.Activity.dispatchActivityResult(Activity.java:5423) 12-30 14:37:26.490: E/AndroidRuntime(14558): at android.app.ActivityThread.deliverResults(ActivityThread.java:3361) 12-30 14:37:26.490: E/AndroidRuntime(14558): ... 11 more </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload