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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:18:56+00:00 2026-06-14T12:18:56+00:00

When you implement SpinnerAdapter you get getDropDownView , how does it differ from getView

  • 0

When you implement SpinnerAdapter you get getDropDownView, how does it differ from getView which you have when you need to extend BaseAdapter.

  • 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-14T12:18:58+00:00Added an answer on June 14, 2026 at 12:18 pm

    If we look at the following code, we have name and value array in getView and getDropDownView.

    private void initView() {
        SpinnerDropDownAdapter sddadapter = new SpinnerDropDownAdapter(this);
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
                android.R.layout.simple_spinner_item, sddadapter.name);
    
        Spinner getViewSP = (Spinner) findViewById(R.id.getview_sp);
        getViewSP.setAdapter(adapter);
    
        Spinner getViewWDropDownSP = (Spinner) findViewById(R.id.getview_w_drop_down_sp);
        getViewWDropDownSP.setAdapter(sddadapter);
    }
    
    static class SpinnerDropDownAdapter extends BaseAdapter implements
            SpinnerAdapter {
        Context context;
    
        SpinnerDropDownAdapter(Context ctx) {
            context = ctx;
        }
    
        String[] name = { " One", " Two", " Three", " Four", " Five", " Six",
                " Seven", " Eight" };
        String[] value = { " 1", " 2", " 3", " 4", " 5", " 6", " 7", " 8" };
    
        @Override
        public int getCount() {
            return name.length;
        }
    
        @Override
        public String getItem(int pos) {
            // TODO Auto-generated method stub
            return name[pos];
        }
    
        @Override
        public long getItemId(int arg0) {
            // TODO Auto-generated method stub
            return 0;
        }
    
        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            TextView text = new TextView(context);
            text.setTextColor(Color.BLACK);
            text.setText(name[position]);
            return text;
        }
    
        @Override
        public View getDropDownView(int position, View convertView,
                ViewGroup parent) {
            TextView text = new TextView(context);
            text.setTextColor(Color.BLACK);
            text.setText(value[position]);
            return text;
        }
    }
    

    If getDropDownView method is not implemented, the drop down pop up will get the view from getView. Thus, it will only show name.

    getView

    When both getView and getDropDownView is implemented, the former getting name and the latter getting value, the spinner at rest will get name from getview and the drop down pop up will get value.
    getView and getDropDownView

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

Sidebar

Related Questions

To implement a callback function from the native code to Java code, I have
To implement github like fork/pull request function in my project, the auto-merge feature need
I'm trying implement A* Start path finding in my games(which are written with JavaScript,
Implement multi-level hierarchies so that super user have also all rights that sub user
I implement a reference counting schema and for this i need interlock facilities but
I implement a faceted search using Lucene. I have an index of documents and
I need to implement a Diff algorithm in VB.NET to find the changes between
I implement game server where I need to both read and write. So I
Implement a function punctuation() that takes no parameters, inputs a string from the user,
Question Implement a function bool chainable(vector<string> v) , which takes a set of strings

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.