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

  • Home
  • SEARCH
  • 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 8429279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:17:29+00:00 2026-06-10T05:17:29+00:00

I have a ListView with a TextView and a Checkbox on every row. I’m

  • 0

I have a ListView with a TextView and a Checkbox on every row. I’m trying to create a sequence where the user has to click on the Checkbox of the first row to enable the next row and remove a grayed out effect. Clicking on the Checkbox in this row will do the same to the next row and so on.

Is this possible? and how?

  • 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-10T05:17:31+00:00Added an answer on June 10, 2026 at 5:17 am

    Create a custom Object to keep the state of your row. For example:

    class Row {
       private TextView text;
       private CheckBox box;
       private boolean grayedOut;
    
       //implementation...
    }
    

    Inside your Activity you make an ArrayList<Row>() and give it as source to the Adapter of your ListView.

    onCreate(..){
       mArrayList = new ArrayList<Row>();
       // fill arraylist
       Adapter mAdapter = new CustomAdapter(... , ... , mArrayList);
       ListView lv = findView..
       lv.setAdapter(mAdapter);
    }
    

    The Adapter for your ListView is custom. You can follow the example found here. In your case some adjustments will be as followed:

    public class CustomAdapter extends ArrayAdapter<Row>{
    
        public CustomAdapter(...) {
            // do stuff
        }
    
        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            // ....
    
            if (item at position has gray state){
                 set layout to gray
            } else {
                 set layout to active
            }
    
            // ....
            return row;
        }
    

    Now we have a Listview, a CustomAdapter and for each item in the list we have an Row which provides a certain state. Default all the states will be set to gray-state except the first item. Using the onItemClickedListener, we can unlock other items..

    lv.setOnItemClickListener(new OnItemClickListener(){
        public void onItemClick(AdapterView<?> parent, View v, int position, Long id){        
             // do stuff...
             mArrayList.get(position+1).setGrayedOut(false);
        }
    }
    

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have ListView. Every row has TextView with some text. And also by default
I have created listview using layoutinflator. Listview contains checkbox and textview for each row.
I have a ListView with some elements on it. Each row has a TextView
I have listview having customized some textview and one imageview. When I long click
I have a listview with custom row having a textview and a clickable image
I have a Custom ListView which has an ImageView and a TextView. and i
I have a ListView with a ContextMenu, it has one CheckBox (the CheckBox has
I have a ListView, which has a TextView and a RadioGroup with 4 RadioButtons
I have a listview with each row having a checkbox, imageview and text view
I'm trying to create a layout for a ListView, with a checkbox to the

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.