olution:
As mentioned above, I just set up a global variable and passed whether I wanted to Select All or Clear All to it. Then I just called my function for populating the ListView. As the ListView is built, it checks the variable in a simple "if" statement, and adds whether to check or uncheck. The cursor adapter then does the check/uncheck as it reruns.
//The code for clearing all.
btnClearAll.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
checkedCount = 0;
GetMusicMode = "ClearAll";
GetMusic getMusic = new GetMusic();
getMusic.execute();
}
});
And this from my data grabber for the ListView.
....
String track_Title = null;
String track_Path = null;
String track_Artist = null;
String track_Album = null;
String track_ID = null;
String track_TrackNumber = null;
String track_AlbumID = null;
String track_ArtistID = null;
String track_Checked = null;
if (Constants.GetMusicMode.equals("SelectAll")){
track_Checked = "Checked";
}else{
track_Checked = "Not Checked";
}
.....
.....
HashMap<String, String> song = new HashMap<String, String>();
song.put("songTitle", track_Title);
song.put("songPath", track_Path);
song.put("songArtist", track_Artist);
song.put("songAlbum", track_Album);
song.put("songTrackNumber", track_TrackNumber);
song.put("songID", track_ID);
song.put("songAlbumID", track_AlbumID);
song.put("songArtistID", track_ArtistID);
song.put("songCheckedStatus", track_Checked);
// Adding each song to SongList
songsList.add(song);
....throw to cursor adapter
and finally, this section from the cursoradapter getview
if (songsList.get(position).get("songCheckedStatus").equals("Checked")){
holder.checkTextView.setChecked(true);
}else{
holder.checkTextView.setChecked(false);
}