I have had several users report a force close from the contact picker
activity on the Samsung Moment. I'm not sure if the Moment uses the
standard Android contact picker or a custom one (though it looks like
the standard one from the activity name). This is the code I am using
to launch the contact picker:

    Intent intent = new Intent
(Intent.ACTION_PICK,Phones.CONTENT_URI);
    startActivityForResult(intent, ADD_CONTACT);

This should display a contact picker listing all phone numbers on the
phone. This works on all phones except the Moment. I was able to get a
logcat listing from a user which shows the following exception:

11-23 12:32:11.910 I/ActivityManager( 1859): Starting activity: Intent
{ action=android.intent.action.PICK data=content://contacts/phones
comp={com.android.contacts/
com.android.contacts.ContactsListActivity} }
11-23 12:32:12.375 I/ActivityManager( 1859): Displayed activity
com.android.contacts/.ContactsListActivity: 464 ms
11-23 12:32:12.505 E/CursorWindow( 4377): Bad request for field slot
0,10. numRows = 213, numColumns = 7
11-23 12:32:12.515 D/AndroidRuntime( 4377): Shutting down VM
11-23 12:32:12.515 W/dalvikvm( 4377): threadid=3: thread exiting with
uncaught exception (group=0x4000fe70)
11-23 12:32:12.515 E/AndroidRuntime( 4377): Uncaught handler: thread
main exiting due to uncaught exception
11-23 12:32:12.560 E/AndroidRuntime( 4377):
java.lang.IllegalStateException: get field slot from row 0 col 10
failed
11-23 12:32:12.560 E/AndroidRuntime( 4377): at
android.database.CursorWindow.getLong_native(Native Method)
11-23 12:32:12.560 E/AndroidRuntime( 4377): at
android.database.CursorWindow.getLong(CursorWindow.java:329)
11-23 12:32:12.560 E/AndroidRuntime( 4377): at
android.database.AbstractWindowedCursor.getLong
(AbstractWindowedCursor.java:108)
11-23 12:32:12.560 E/AndroidRuntime( 4377): at
android.database.CursorWrapper.getLong(CursorWrapper.java:127)
11-23 12:32:12.560 E/AndroidRuntime( 4377): at
com.android.contacts.ContactsListActivity
$ContactItemListAdapter.bindView(ContactsListActivity.java:2139)
11-23 12:32:12.560 E/AndroidRuntime( 4377): at
com.android.contacts.ContactsListActivity
$ContactItemListAdapter.getView(ContactsListActivity.java:2010)


It looks like the Phone Number table on the Moment only has 7 columns.
The same table on the Android 1.5 emulator has 20 columns. This seems
to be what is causing the contact picker activity to fail. Does anyone
know why the Moment has a different Phone Number table? I think I may
need to create my own contact picker for my app to work with the
Moment. I will need to know what the 7 columns are for the Moment's
phone number table though. If someone has a Moment would you be
willing to query the phone number table to find out what the column
names are. The following code should return a Cursor object with the
table names:

Cursor cursor = context.getContentResolver().query
(Phones.CONTENT_URI,null,null,null,null);

Any help would be appreciated.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to