Note that there are some explanatory texts on larger screens.

plurals
  1. POMemory issue/ Cursor shows null pointer
    primarykey
    data
    text
    <p>I am getting the name and email id of the contacts and it works fine in HTC Desire, but whenever i tried to run the code in galaxy tab it shows me No memory in memObj and null pointer on... while (emailCur.moveToNext()) .</p> <p>Here's my code</p> <pre><code>private void getPeopleList() { String name, email; Runtime.getRuntime().maxMemory(); c = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null); if (c.getCount() &gt; 0) { while (c.moveToNext()) { name = c.getString(c .getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME)); String id = c.getString(c .getColumnIndex(BaseColumns._ID)); cr.query( ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " = ?", new String[] { id }, null); emailCur = cr.query(Email.CONTENT_URI, null, Email.CONTACT_ID + " = " + id, null, null); int j = 0; while (emailCur.moveToNext()) { bindData = new BindData[emailCur.getCount()]; bindData = new BindData(); email = emailCur .getString(emailCur .getColumnIndex(ContactsContract.CommonDataKinds.Email.DATA)); bindData.setEmailId(email); bindData.setName(name); Log.d("doubt : ", name+"//"+email); mArrayList.add(bindData); j++; } emailCur.close(); } c.close(); } } </code></pre> <p>I am calling this method using worker thread runnable.</p> <p>If any information is required let me know.</p> <p>here's my log cat</p> <pre><code>06-29 16:13:26.854: ERROR/IMemory(6180): binder=0xdf3f68 transaction failed fd=-2147483647, size=0, err=-2147483646 (Unknown error: 2147483646) 06-29 16:13:26.854: ERROR/IMemory(6180): cannot dup fd=-2147483647, size=0, err=-2147483646 (Bad file number) 06-29 16:13:26.854: ERROR/IMemory(6180): cannot map BpMemoryHeap (binder=0xdf3f68), size=0, fd=-1 (Bad file number) 06-29 16:13:26.854: ERROR/JavaBinder(6180): *** Uncaught remote exception! (Exceptions are not yet supported across processes.) 06-29 16:13:26.854: ERROR/JavaBinder(6180): java.lang.RuntimeException: No memory in memObj 06-29 16:13:26.854: ERROR/JavaBinder(6180): at android.database.CursorWindow.native_init(Native Method) 06-29 16:13:26.854: ERROR/JavaBinder(6180): at android.database.CursorWindow.&lt;init&gt;(CursorWindow.java:518) 06-29 16:13:26.854: ERROR/JavaBinder(6180): at android.database.CursorWindow.&lt;init&gt;(CursorWindow.java:27) 06-29 16:13:26.854: ERROR/JavaBinder(6180): at android.database.CursorWindow$1.createFromParcel(CursorWindow.java:493) 06-29 16:13:26.854: ERROR/JavaBinder(6180): at android.database.CursorWindow$1.createFromParcel(CursorWindow.java:496) 06-29 16:13:26.854: ERROR/JavaBinder(6180): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:103) 06-29 16:13:26.854: ERROR/JavaBinder(6180): at android.os.Binder.execTransact(Binder.java:288) 06-29 16:13:26.854: ERROR/JavaBinder(6180): at dalvik.system.NativeStart.run(Native Method) 06-29 16:13:26.858: ERROR/AndroidRuntime(6388): FATAL EXCEPTION: main 06-29 16:13:26.858: ERROR/AndroidRuntime(6388): java.lang.NullPointerException 06-29 16:13:26.858: ERROR/AndroidRuntime(6388): at com.meomyo.fanaticfaninit.utils.MyCustomList.getPeopleList(MyCustomList.java:172) 06-29 16:13:26.858: ERROR/AndroidRuntime(6388): at com.meomyo.fanaticfaninit.utils.MyCustomList.access$0(MyCustomList.java:144) 06-29 16:13:26.858: ERROR/AndroidRuntime(6388): at com.meomyo.fanaticfaninit.utils.MyCustomList$1.run(MyCustomList.java:121) 06-29 16:13:26.858: ERROR/AndroidRuntime(6388): at android.os.Handler.handleCallback(Handler.java:587) 06-29 16:13:26.858: ERROR/AndroidRuntime(6388): at android.os.Handler.dispatchMessage(Handler.java:92) 06-29 16:13:26.858: ERROR/AndroidRuntime(6388): at android.os.Looper.loop(Looper.java:123) 06-29 16:13:26.858: ERROR/AndroidRuntime(6388): at android.app.ActivityThread.main(ActivityThread.java:4627) 06-29 16:13:26.858: ERROR/AndroidRuntime(6388): at java.lang.reflect.Method.invokeNative(Native Method) 06-29 16:13:26.858: ERROR/AndroidRuntime(6388): at java.lang.reflect.Method.invoke(Method.java:521) 06-29 16:13:26.858: ERROR/AndroidRuntime(6388): at </code></pre>
    singulars
    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.
 

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