I now got this to work.  The solution is here 
http://stackoverflow.com/questions/10224233/alphabetindexer-with-custom-adapter-managed-by-loadermanager

On Wednesday, April 25, 2012 9:30:36 PM UTC-7, Etienne wrote:
>
> Here is the stack trace:
>
> 04-25 01:37:23.280: E/AndroidRuntime(711): FATAL EXCEPTION: main
> 04-25 01:37:23.280: E/AndroidRuntime(711): java.lang.RuntimeException: 
> Unable to start activity 
> ComponentInfo{com.sendit/com.sendit.ContactManager}: 
> java.lang.NullPointerException
> 04-25 01:37:23.280: E/AndroidRuntime(711): at 
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
> 04-25 01:37:23.280: E/AndroidRuntime(711): at 
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
> 04-25 01:37:23.280: E/AndroidRuntime(711): at 
> android.app.ActivityThread.access$600(ActivityThread.java:123)
> 04-25 01:37:23.280: E/AndroidRuntime(711): at 
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
> 04-25 01:37:23.280: E/AndroidRuntime(711): at 
> android.os.Handler.dispatchMessage(Handler.java:99)
> 04-25 01:37:23.280: E/AndroidRuntime(711): at 
> android.os.Looper.loop(Looper.java:137)
> 04-25 01:37:23.280: E/AndroidRuntime(711): at 
> android.app.ActivityThread.main(ActivityThread.java:4424)
> 04-25 01:37:23.280: E/AndroidRuntime(711): at 
> java.lang.reflect.Method.invokeNative(Native Method)
> 04-25 01:37:23.280: E/AndroidRuntime(711): at 
> java.lang.reflect.Method.invoke(Method.java:511)
> 04-25 01:37:23.280: E/AndroidRuntime(711): at 
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
> 04-25 01:37:23.280: E/AndroidRuntime(711): at 
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
> 04-25 01:37:23.280: E/AndroidRuntime(711): at 
> dalvik.system.NativeStart.main(Native Method)
> 04-25 01:37:23.280: E/AndroidRuntime(711): Caused by: 
> java.lang.NullPointerException
> 04-25 01:37:23.280: E/AndroidRuntime(711): at 
> com.sendit.ContactsCursorAdapter.getSections(ContactsCursorAdapter.java:222)
> 04-25 01:37:23.280: E/AndroidRuntime(711): at 
> android.widget.FastScroller.getSectionsFromIndexer(FastScroller.java:507)
> 04-25 01:37:23.280: E/AndroidRuntime(711): at 
> android.widget.FastScroller.init(FastScroller.java:269)
> 04-25 01:37:23.280: E/AndroidRuntime(711): at 
> android.widget.FastScroller.<init>(FastScroller.java:155)
> 04-25 01:37:23.280: E/AndroidRuntime(711): at 
> android.widget.AbsListView.setFastScrollEnabled(AbsListView.java:1144)
> 04-25 01:37:23.280: E/AndroidRuntime(711): at 
> com.sendit.LoaderCursor$ContactsCursorLoaderListFragment.onActivityCreated(LoaderCursor.java:107)
> 04-25 01:37:23.280: E/AndroidRuntime(711): at 
> android.app.FragmentManagerImpl.moveToState(FragmentManager.java:847)
> 04-25 01:37:23.280: E/AndroidRuntime(711): at 
> android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1032)
> 04-25 01:37:23.280: E/AndroidRuntime(711): at 
> android.app.BackStackRecord.run(BackStackRecord.java:622)
> 04-25 01:37:23.280: E/AndroidRuntime(711): at 
> android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1382)
> 04-25 01:37:23.280: E/AndroidRuntime(711): at 
> android.app.Activity.performStart(Activity.java:4474)
> 04-25 01:37:23.280: E/AndroidRuntime(711): at 
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1929)
> 04-25 01:37:23.280: E/AndroidRuntime(711): ... 11 more
>
> after the setFastScrollEnabled() method gets called it calls the custom 
> adapter's getSections() method which is where it crashes.
>
> On Wednesday, April 25, 2012 3:04:44 AM UTC-7, Kostya Vasilyev wrote:
>>
>> How does it "error out"? A crash? What's the stack trace?
>>
>> In general, the fast section indexer does not update its sections list 
>> automatically when you replace the cursor. There is no method to force 
>> this except turn it off and the back on after you've changed the data.
>>
>> -- K
>>
>> 25.04.2012 11:02, Etienne написал:
>> > And if I comment the setFastScrollEnabled() call, then it does not 
>> > error out, but I do not see the AlphabetIndexer working. Does anyone 
>> > have suggestions about how to make this all work?
>>
>> -- 
>> Kostya Vasilyev
>>
>>

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

Reply via email to