Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8535915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:32:40+00:00 2026-06-11T10:32:40+00:00

I have a ListView that utilizes a CheckedTextView and a clear all button that

  • 0

I have a ListView that utilizes a CheckedTextView and a clear all button that has the following code:

btnClearAll.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            int listsize = songsList.size();
            filelv = (ListView)getView().findViewById(R.id.FileList);
            checkedCount = 0;
            for (int i=0; i<listsize-1; i++) {
                // if(currentPlayList.get(i).equals ("Checked")){
                songsList.get(i).get("songCheckedStatus").equals("Not Checked");

                filelv.setItemChecked(i, false);
            } 

        }       
    });

When the code executes, each array “songsList” value is set to “Not Checked” correctly, so I know that the button is working. However, the CheckedTextView items are not “unticking”.

Where am I going wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T10:32:41+00:00Added an answer on June 11, 2026 at 10:32 am

    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); 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have ListView that has the following EditItemTemplate: <EditItemTemplate> <tr style=> <td> <asp:LinkButton ID=UpdateButton
I have a ListView that has a Button in the item template. Is there
I have a ListView that is a View and this all the properties will
I have a ListView that displays a link button. I need the link button
I have a ListView that has a custom ArrayAdapter with a custom XML row.
I have a listview that has multiple entries and each entry has 2 subitems.
I have a ListView that has two columns, one for a zone name and
I have a ListView that each row has a title on the left side
I have a listview that has a photograph from the gallery for each entry
I have a ListView that has a subtle gradient bitmap in the background of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.