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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:49:50+00:00 2026-06-17T17:49:50+00:00

My listview background doesn’t change when calling listView.setBackgroundDrawable() . I’ve searched a lot but

  • 0

My listview background doesn’t change when calling listView.setBackgroundDrawable().

I’ve searched a lot but didn’t find a solution.

This is the code

ListView v= new ListView(Menu2.this);
v.setBackgroundDrawable(getResources().getDrawable(R.drawable.android));
Context c=v.getContext();
setListAdapter(new ArrayAdapter(c, android.R.layout.simple_list_item_1, list));

The background stays as if I didn’t call the method.

Thanks.

  • 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-17T17:49:51+00:00Added an answer on June 17, 2026 at 5:49 pm

    Use this :

    ListView v= getListView();
    v.setBackground(getResources().getDrawable(R.drawable.android));
    

    Instead of,

    ListView v= new ListView(Menu2.this);
    v.setBackgroundDrawable(getResources().getDrawable(R.drawable.android));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I change the background of a single cell of a ListView? I
I've been searching for this for quite a while but can't seem to find
Background: I have a ListView / GridView with several columns. In some situations, only
I have a background color applied to a ListView <style name=CKButtons> <item name=android:windowBackground>@color/window_background</item> </style>
I have an Activity with a ListView, I set the background image to the
I have a ListView on my Android Activity. When I scroll it, the background
I'm having a problem styling my ListBox selection background. I used ListView originally, it
I have the following problem. The background color in a ListView is set LightGreen
In my application, I apply the transparent background to my ListView 's CustomListItem at
I bind List of items to WPF ListView and want to set row background/foreground

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.