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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:49:19+00:00 2026-06-04T00:49:19+00:00

I have a white background but with this layout i am blocked because text

  • 0

I have a white background but with this layout i am blocked because text color is white too and i can’t find a solution to make it red so i can set my white background, any help please (as u can see i am forced to use a red background her so i can see the white text).

public class QueueListActivity extends ListActivity {
// LIST OF ARRAY STRINGS WHICH WILL SERVE AS LIST ITEMS
ArrayList<String> listItems = new ArrayList<String>();
String newtext;
String listFiles;
// DEFINING STRING ADAPTER WHICH WILL HANDLE DATA OF LISTVIEW
ArrayAdapter<String> adapter;

// RECORDING HOW MUCH TIMES BUTTON WAS CLICKED
int clickCounter = 0;

ArrayList<String> selectedItems = new ArrayList<String>();


@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    setContentView(R.layout.queuelistactivity);
    Bundle extras1 = getIntent().getExtras(); 
    listFiles=GetFiles();

    StringTokenizer tokonizer1 = new StringTokenizer(listFiles,";");
    while(tokonizer1.hasMoreElements()){
        Log.i("verif","0");
        listItems.add(tokonizer1.nextToken());}
          initializeListItems();



    if (extras1 != null) {
        newtext = extras1.getString("newitem");
        listItems.add(newtext);
        adapter.notifyDataSetChanged();
        getListView().setItemChecked(listItems.size() - 1, false);

    }




}



// METHOD WHICH WILL HANDLE DYNAMIC INSERTION
public void addItems(View v) {

    Intent intent = new Intent(QueueListActivity.this, AjouterFiles.class);     
    QueueListActivity.this.startActivity(intent);


    /*
    listItems.add(userName);
    adapter.notifyDataSetChanged();
    getListView().setItemChecked(listItems.size() - 1, false);*/


}

public void deleteItems(View v) {
    String toDelete = "";
    SparseBooleanArray sp = getListView().getCheckedItemPositions();

    for (int i = 0; i < sp.size(); i++) {
        toDelete += ";" + sp.get(i);
        if (sp.get(i)) {
            listItems.remove(i);
        }

    }
    adapter.notifyDataSetChanged();
    Toast.makeText(getApplicationContext(), toDelete, Toast.LENGTH_LONG).show();
    initializeListItems();
}

private void initializeListItems() {
    adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_multiple_choice, listItems);
    setListAdapter(adapter);
    ListView lv = getListView();
    lv.setCacheColorHint(Color.rgb(0, 0, 0));
    lv.setBackgroundColor(Color.rgb(178, 34, 34));


    for (int i = 0; i < lv.getCount(); i++) {
        lv.setItemChecked(i, false);
    }
}
  • 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-04T00:49:23+00:00Added an answer on June 4, 2026 at 12:49 am

    Best trick is you copy content layout file from android.R.layout.simple_list_item_multiple_choice and make your own layout(my_list_view and edit the xml file and change the text color.

    adapter = new ArrayAdapter(this,my_list_view, listItems);

    Edit save this file as my_list_view;

    <CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@android:id/text1"
        android:layout_width="match_parent"
        android:layout_height="?android:attr/listPreferredItemHeight"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:gravity="center_vertical"
        android:checkMark="?android:attr/listChoiceIndicatorMultiple"
        android:paddingLeft="6dip"
        android:paddingRight="6dip"
        android:background="#FFFFFF" //white background
        android:textColor="#000000" //black color text
    />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have the following simple code, but it doesn,t work <ul> <li id=one onmouseover=this.style.background-color='white';>
I have a VB.NET form with a red background and white text. I want
I have a EditText in a layout with a white background. On Android 2.x,
I've been searching for this for quite a while but can't seem to find
I am working on paint application, where I have set layout background in white
I have to do a background process which will perform some operations.. while this
Say I have an array like this: [white, red, blue, red, white, green, red,
i need to implement this layout in android..the view must be have two list
I want to make android home page background. I have imported a video file
I have an XML layout like this: <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical android:layout_width=match_parent

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.