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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:23:20+00:00 2026-05-31T23:23:20+00:00

How can I make a list with pictures and summary (the text under the

  • 0

How can I make a list with pictures and summary (the text under the item list text) it is little description to item.

My code makes a list with pictures. How can I add a Summary?

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

 <ImageView
    android:id="@+id/icon"
    android:layout_width="22px"
    android:layout_height="22px"
    android:layout_marginLeft="4px"
    android:layout_marginRight="10px"
    android:layout_marginTop="4px"
    android:src="@drawable/ic_launcher" >
</ImageView>

<TextView
    android:id="@+id/label"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@+id/label"
    android:textSize="20px" >
 </TextView>

 </LinearLayout>

Activity class:

public class MyListActivity extends ListActivity {
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        String[] values = new String[] { "Android", "iPhone", "WindowsMobile",
            "Blackberry", "WebOS", "Ubuntu", "Windows7", "Max OS X",
            "Linux", "OS/2" };
        // Use your own layout
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
        R.layout.rowlayout, R.id.label, values);
        setListAdapter(adapter);
    }

    @Override
    protected void onListItemClick(ListView l, View v, int position, long id) {
        String item = (String) getListAdapter().getItem(position);
        Toast.makeText(this, item + " selected", Toast.LENGTH_LONG).show();
    }
}
  • 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-31T23:23:21+00:00Added an answer on May 31, 2026 at 11:23 pm

    You can create a costum listview with a costum layout.

    In the internet you found a lot of good tutorials to teach you that.

    Here is an example:
    http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/

    The only difference to your case is that the image is on the left of the text and you want it on the top :).

    If your list has always the same content you can create an adapter that already knows that content. Otherwise, you need to create a class to hold the type of content you will have on your list. It seems your content is static, so, I will suggest some lines for you to follow.

    Mainly you have to create your adapter:

    private class MyAdapter extends ArrayAdapter {
    
        private String[] values = new String[] { "Android", "iPhone", "WindowsMobile",
            "Blackberry", "WebOS", "Ubuntu", "Windows7", "Max OS X",
            "Linux", "OS/2" };
    
        private int[] myImagesSaved = new Int[] { R.drawable.image1, 
                                                  R.drawable.image2, ... }
    
        public MyAdapter (Context context, int textViewResourceId) {
           super(context, textViewResourceId, values);
        }
    
        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            View v = convertView;
    
            if (v == null) {
                LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                v = vi.inflate(R.layout.row, null);
            }              
    
            TextView text = (TextView) v.findViewById(R.id.icon);
            ImageView image = (TextView) v.findViewById(R.id.label);
    
            if (text != null) 
               text.setText(values[position]);                            }
    
            if(image != null)
               image.setBackgroundResource(myImagesSaved[position]);
    
            return v;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how can i make it possible say i have a unordered list of 17
How can I make the anchor tag expand to the bottom of the list
I want to make an MVC route for a list of news, which can
I want to make a drop-down list from scratch. Can anyone please tell me
I can make a DAO recordset in VB6/Access do anything - add data, clean
I'm trying to create a Django app where the user can make a list
Can I make a list of numbers from 1 to 6 in one line
how i can make a list on canvas in an application having more then
i have a 4 list in c# how i can make a list from
Can we make our own List<string, string, string> in C#.NET? I need to make

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.