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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:21:29+00:00 2026-05-23T10:21:29+00:00

I have in my app a ListView with adapter , I use this to

  • 0

I have in my app a ListView with adapter, I use this to show a list with a chechbox and a textView

public class MyListAdapter extends ArrayAdapter<Model> {
    private LayoutInflater inflater;
    private int position;

    public int getPosition() {
        return position;
    }

    public void setPosition(int position) {
        this.position = position;
    }

    public MyListAdapter (Context context, List<Model> listMeasurement){
        super(context, R.layout.simplerow, R.id.empty, listMeasurement);
        inflater= LayoutInflater.from(context);
    }

    public View getView(int position, View convertView, ViewGroup parent){
        Model model= (Model)this.getItem(position);
        CheckBox checkBox;
        TextView textView;
    }
}

My question is:

I want to show another list in another activity, this will have an image, two textViews and a button. The image depends on the value of the textView.

The best way to do this is do other ArrayAdapter? or use other things?

Thanks in advance.

  • 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-23T10:21:30+00:00Added an answer on May 23, 2026 at 10:21 am

    You need to extend the BaseAdapter and override the getView() method. Here is a sample.

        private class CustomAdapter extends BaseAdapter {
    
            private LayoutInflater inflater;
            private ArrayList<Model> list;
    
            public CustomAdapter(Context context, ArrayList<Model> list) {
                this.inflater = LayoutInflater.from(context);
                            this.list = list;
            }
    
            @Override
            public int getCount() {
                        return list.size();
            }
    
            @Override
            public Object getItem(int position) {
               return list.get(position);
            }
    
            @Override
            public long getItemId(int position) {
                return position;
            }
    
            @Override
            public View getView(int position, View view, ViewGroup parent) {
    
                // If the view is null inflate it from xml
                if (view == null)
                    view = inflater.inflate(R.layout.list_row, null);
    
                // Bind xml to java
               ImageView icon = (ImageView) view
                    .findViewById(R.id.image);
               TextView text = (TextView) view.findViewById(R.id.text);
                           text.setText(list.get(position).getText());
                           icon.setImageDrawable(list.get(position).getDrawable());
    
               return view;
           }
    
       }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this getView method inside my ListViewAdapter: public static class ViewHolder{ public TextView
I have a listview extends Activity and use custom adapter because I want icon
I have a WPF App that implements a ListView. I would like to show
I have this method inside an Activity which implements an ImageLoader class: public void
Hi i have a tab activity which show a list of items (ListView) .
I have an app using a ListView as a main screen. Each row displays
I have an app with a large ListView which is terribly slow so I'm
If I have two activities in my app, one with listview and the other
I have a ListView that uses a customized adapter, but I can't click on
I have a listview with a custom arrayadapter that handles about 15 strings. The

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.