Hi, Did you tried : onClick(DialogInterface dialog, int which)
I think you can update your list adapter according to the "wich" parameter. -- Will On 19 avr, 03:45, greg <sep...@eduneer.com> wrote: > I have an activity with a ListView check list and a spinner that > controls the sort order of the items in that check list. One of the > sort options is to move the checked items to the beginning of the > list. I would like to allow users to check some items in the list, > select the 'sort by checks' option, check some more items in the list, > and select the 'sort by checks' option again. However, I don't see > how to detect that second selection of the spinner's 'sort by checks' > option. > > I've tried using setOnItemSelectedListener, but it doesn't call the > onItemSelected handler unless a different item is selected. And I've > tried using setOnItemClickListener, but it seems that listener cannot > be used with a spinner according to following run-time exception from > logcat: > > - - - > D/AndroidRuntime( 987): Shutting down VM > W/dalvikvm( 987): threadid=3: thread exiting with uncaught exception > (group=0x4000fe70) > E/AndroidRuntime( 987): Uncaught handler: thread main exiting due to > uncaught exception > E/AndroidRuntime( 987): java.lang.RuntimeException: Unable to start > activity ComponentInfo{com.test.spinner/com.test.spinner.check_list}: > java.lang.RuntimeException: setOnItemClickListener cannot be used with > a spinner. > E/AndroidRuntime( 987): at > android.app.ActivityThread.performLaunchActivity(ActivityThread.java: > 2268) > - - - > > Any tips on how to detect the selection of an already selected item in > a spinner? > > Thanks, > Greg > > -- > 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 > athttp://groups.google.com/group/android-developers?hl=en -- 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