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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:20:17+00:00 2026-05-20T10:20:17+00:00

I’m tryin to make a list box that has a different image and text

  • 0

I’m tryin to make a list box that has a different image and text for each listed item. I tried to creat two setListAdapter, one for the text string to be displayed and another for the image name. It did not work, I’m assuming there is another way to do this.

My CTICTY CLASS FOR THE LIST

public class cFashions extends ListActivity  {
    TextView selection;
    // list to fill list box wi*/
/*
    String[] items={"CASUAL","DR ESSES","CAREER","OUTWEAR","FOOTWEAR",
            "JEWELRY","ACCESSORIES"};
*/
    String[] items={"CASUAL"};
    String[] icons={"icon"};

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.fashions);

        setListAdapter(new ArrayAdapter<String>(this,
            R.layout.row, R.id.label,
            items));

        setListAdapter(new ArrayAdapter<String>(this,
            R.layout.row, R.id.icon,
            icons));
            selection=(TextView)findViewById(R.id.selection);
   }
}

THE XML FILE FOR THE LAYOUT OF EACH CELL IN THE LIST

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
>

<ImageView
        android:id="@+id/icon"
        android:layout_width="22px"
        android:paddingLeft="2px"
        android:paddingRight="2px"
        android:paddingTop="2px"
        android:layout_height="wrap_content"

    />

    <TextView
        android:id="@+id/label"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="12sp"
    />
</LinearLayout>

Ted

  • 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-05-20T10:20:18+00:00Added an answer on May 20, 2026 at 10:20 am

    You need to use one adapter, not two, where the adapter knows how to handle both your TextView and your ImageView. Here is a free excerpt from one of my books that covers this topic in detail.

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

Sidebar

Related Questions

Ok,I'm trying to make a List view that will list some places ,where each
I am trying to make a list box where I have complete control over
I'm trying to make a list containing different objects. List<Object> list = new ArrayList<Object>();
I am trying to make a method that will go through a list of
I'm trying to make a box that allows you to select some variables, and
I'm trying to setup a ListBox so that every item has a textblock and
I'm trying to make a combo box that behaves somewhat like the Firefox 3
I'm just trying to make a list of questions with hidden answers that shows
I have a combo box inside a list view. And different items (rows) in
I was trying to add some visual feed back for a list box that

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.