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 8530523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:16:02+00:00 2026-06-11T09:16:02+00:00

Is it possible to change listview color or background color on every 10 or

  • 0

enter image description here

Is it possible to change listview color or background color on every 10 or 15 seconds.I have used existing code for this listview. Where to add necessary step inside mycode.I don’t want to change color for user everytime select item. If user simple open my app and 10seconds over backgroundcolor automatically change.

MyCode:

public class MainActivity extends Activity {
    private ListView lv;
    private EditText et;
    private String listview_array[] = { "ONE", "TWO", "THREE", "FOUR", "FIVE",
    "SIX", "SEVEN", "EIGHT", "NINE", "TEN" };
    private ArrayList<String> array_sort= new ArrayList<String>();
    int textlength=0;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        lv = (ListView) findViewById(R.id.ListView01);
        et = (EditText) findViewById(R.id.EditText01);
        lv.setAdapter(new ArrayAdapter<String>(this,
        android.R.layout.simple_list_item_1, listview_array));

        et.addTextChangedListener(new TextWatcher()
        {
        public void afterTextChanged(Editable s)
        {
                                                                        // Abstract Method of TextWatcher Interface.
        }
        public void beforeTextChanged(CharSequence s,
        int start, int count, int after)
        {
        // Abstract Method of TextWatcher Interface.
        }
        public void onTextChanged(CharSequence s,
        int start, int before, int count)
        {
        textlength = et.getText().length();
        array_sort.clear();
        for (int i = 0; i < listview_array.length; i++)
        {
        if (textlength <= listview_array[i].length())
        {
        if(et.getText().toString().equalsIgnoreCase(
        (String)
        listview_array[i].subSequence(0,
        textlength)))
        {
                                                                                                                        array_sort.add(listview_array[i]);
                                                                                                        }
                                                                                        }
                                                                        }
        lv.setAdapter(new ArrayAdapter<String>
        (MainActivity.this,
        android.R.layout.simple_list_item_1, array_sort));
        }
        });

    }
  • 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-11T09:16:03+00:00Added an answer on June 11, 2026 at 9:16 am

    in the getview() of the customview change color of the text view that you are inflating with.
    And use notifydatasetchanged() every time you need

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

Sidebar

Related Questions

I have a LinearLayout that I would like to change the background color of
Is it possible to change the color of View Results text in below ?
is it possible to change the Audience of an already existing Post in my
Is it possible to change only Y value of background position in CSS? background-position-y
I would like to change text and back ground color of my Listview without
Is it possible to change the color or appearance of the scrollbar in a
Looks like there are two possible ways to change something in the ListView rows:
I have a ListView which its contents could change at any time (eg. a
Possible Duplicate: Navigate between panorama items wp7 I have a listview in the default
In a Windows Forms application, is it possible to change the color of a

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.