how to select all or deselect all views in listview using checkboxes in android?

by Akash Gupta » Fri, 05 Jun 2009 03:12:13 GMT

Sponsored Links
 how to select all or deselect all views in listview using checkboxes
in android?


Other Threads

1. Solution to why list item text is invisible in AlertDialog

I have seen several posts (which for some reason I cannot reply to)
that complain that there list item text is invisible when inside an
AlertDialog unless they select it.  I ran into this problem and wanted
to post my solution.

If you use AlertDialog.Builder.setItems with a simple string array,
then the Builder will create a ListView for you using
R.layout.select_dialog_item resource.  This creates working dialogs
with visible text.  The problem is when you try to use your own layout
resource (perhaps to get a two line list item layout) with your own
adapter with AlertDialog.Builder.setAdatper.  You might try to use
android.R.layout.simple_list_item_2 like I did.  This causes the
invisible text problem.

The actual problem is simply a text color issue.
android.R.layout.simple_list_item_2 uses white for the text color
which is the same color as the background of an AlertDialog, causing a
white on white situation making the text invisible.  The
R.layout.select_dialog_item layout resource used by
AlertDialog.Builder by default when using setItems specifies a text
color of android:textColor="@android:color/
primary_text_light_disable_only" which usually maps to black making
the text visible.

Therefore, to fix this problem, you need to get your text color to be
what AlertDialog would normally choose by default.  What I did was to
copy the android.R.layout.simple_list_item_2 source code xml file to
my own project so that I could edit it.  I added the setting of the
textColor with:


I first tried using @android:color/primary_text_light_disable_only,
but that would not compile because it is not public to app
developers.  I scanne the android source and discovered that ?
android:attr/textColorPrimaryInverseDisableOnly maps to the exact same
thing as @android:color/primary_text_light_disable_only, so it works


2. Service not running when phone is locked

In my application i written a service which will continuously track
the location using GPS.But when phone is locked service is not
tracking the location. Anyone having any idea ? Please let me know.


3. Anyone with Nexus One and Logcat? My program is crashing...

4. Android Applications for Web Browsers

5. HttpPost abort not returning immediately when called from separate thread

6. view list of extra's for a intent

7. Moto Milestone device drivers for XP/32?