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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:17:22+00:00 2026-05-13T18:17:22+00:00

I am making an android application that shows a list with users, I would

  • 0

I am making an android application that shows a list with users, I would like to add the image,name,status,and a button in every row of the list, just like in the androids 1.6 native caller-> favorites tab.Until know I have managed to add the image and name using an ListActivity but when I try to add the button the list becomes unselected.So I have 2 questions, first is the list mentioned above listviews or listactivities? also is this possible using listActivity? and second, what is the difference of the above mentioned classes? any link to tutorials would be appreciated.

  • 1 1 Answer
  • 2 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-13T18:17:22+00:00Added an answer on May 13, 2026 at 6:17 pm

    You will need to extend ListActivity and ListAdapter to implement your design. The activity that displays your list should extend ListActivity instead of Activity. In the onCreate method of your ListActiviry, the content view of your activity should be set to a linear layout that is the parent of a listview. The list view must have id “@+id/android:list”. You can also include a textview to be displayed when the list is empty, see below. Also in OnCreate call setListAdapter() and pass in a new object of your that extends ListAdapter.

    In the class that you make that extends ListAdapter, override all of the methods that you need to, especially getView().

    Example code:

    MyListActivity.java

    import android.app.ListActivity;
    public class MyListActivity extends ListActivity {
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.my_list);
            setListAdapter(new MyListAdapter());
        }
    }
    

    my_list.xml

    <?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="fill_parent">
        <ListView android:id="@+id/android:list"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content" />
        <TextView android:id="@+id/android:empty"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:text="No Events!"/>
    </LinearLayout>
    

    MyListAdapter.java

    import android.widget.ListAdapter;
    
    public class MyListAdapter implements ListAdapter {
      //Methods to load your data
    
      public View getView(int arg0, View reuse, ViewGroup parent) {
        //Create the view or if reuse is not null then reuse it.
        //Add whatever kind of widgets you want here and return the view object
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making an android application that needs to add items to a dynamic
I'm making an Android application that, among other things, shows websites in a webview.
I am making an android application and I want that it would be the
I am making an android application that loads files from a directory on the
I am making an android application, which takes an image from camera and then
I am making an android application that will play an mp3 file once a
I'm making an Android application that reads an XML Internet. This application uses SAX
I am making an android application that uses a listview. I want to get
I am making an android application that needs to display all of the items
i am making one application in Android 2.2 in that application i want to

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.