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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:06:39+00:00 2026-06-15T04:06:39+00:00

I have created the main.xml and the list.xml my java class extends menuActivity I

  • 0

I have created the main.xml and the list.xml
my java class extends menuActivity
I have 2 vectors–

 Vector<String> name=new Vector<String>();
   Vector<String> nickname=new Vector<String>();

i have created my custom holder class too.
my question is how do i pass this two list into my adapter class.
which adapter should i use?

i tried putting this two vectors inside another list and sending that list to my custom adpater class.But it didnt work out.
I am stuck here.
What is the difference between baseadpater and an array adapter?

  • 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-15T04:06:40+00:00Added an answer on June 15, 2026 at 4:06 am

    All BaseAdpater does is solidify the callbacks necessary for a for an AbsListView. An ArrayAdater is a more comprehensive adapter that auto-inflates a list of items into a TextViews.

    For your situation, I recommend extending BaseAdapter:

    class MyAdapter extends BaseAdapter {
        Vector<String> names;
        Vector<String> nicks;
    
        public MyAdapter(Vector<String> nms, Vector<String> nks) {
            if (nms.size() != nks.size())
                throw new RuntimeException("oops! Wrong sizes for vectors");
            name = nms;
            nicks = nks;
        }
    
        @Override
        public int getCount() {
            return names.getSize() &&  nicks.getSize();
        }
    
        @Override
        public String getItem() {
            // Can't really implement with two vectors.
            return null;
        }
    
        @Override
        public getView(int pos, View convert, ViewGroup mommy) {
            LinearLayout ll = (LinearLayout)convert;
    
            if (ll == null)
                // Inflate the linear layout - preferrably from resources
    
            ViewHolder vh = (ViewHolder)ll.getTag();
    
            if (vh == null)
                // Inflate ViewHolder
    
            vh.tvname.setText(names.get(pos));
            vh.tvnick.setText(nicks.get(pos));
            return ll;
        }
    
        class ViewHolder {
            TextView tvname, tvnick;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created one view, view code is, public class MyDraw extends View{ //List<Point>
I have created a list form that gets attached to a main form in
I have a Main class and a HelloWorld class. I have created a button
I have created an array Man: public main blah blah{ man = man[10]; }
I have created a very simple GUI project in Qt as follows: main: #include
I have created a piece of code which takes an IP address (from main
I have created a MY_Controller and I'm linking to it through my main controller...
Hey Guys, i have created the following Menu Structure: <div id=menu> <ul> <li><a href=#>Main
I have some BitmapFrames created on a thread other than the main UI thread;
I have my main class PayUnit where I create my main object references, such

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.