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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:00:09+00:00 2026-06-03T01:00:09+00:00

I have a created a custom ArrayAdapter to hold a tuple. I use one

  • 0

I have a created a custom ArrayAdapter to hold a tuple. I use one of the items in the tuple as the text to be displayed on a spinner which I have placed on a page.
Here is the code for my ArrayAdapter:

public class SpinAdapter extends ArrayAdapter<ObjectsForSpinner> {
    private ArrayList<ObjectsForSpinner> _values;
    public ObjectsForSpinner getItem(int position)
    {
        return _values.get(position);
    }
    @Override
    public View getView(int position, View convertView, ViewGroup parent) 
    {
         TextView label = new TextView(context);
         label.settextColor(Color.BLACK);
         label.setBackgroundColor(Color.TRANSPARENT);
         label.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
         label.setText(_values.get(position).getSpinnerStr());
         return label;
    }
}

_values.get(position).getSpinnerStr() is where I return the text. The return type is String. The problem is the text is not displayed completely. When I return Sales Department it only shows Sales without Department.

I even tried label.setEllipsize(TruncateAt.END); but no luck yet. Would some one please tell me how to go around this problem.

  • 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-03T01:00:11+00:00Added an answer on June 3, 2026 at 1:00 am

    I have faced this problem before. The problem is that the TextView inside your Spinner completely ignores the parts after the space character when the TextView size is smaller than the whole String. You could identify this by removing the space characters from your String and displaying it. It will show you the part of the text that could fit inside your TextView. But the moment the spaces are back, they are all gone.

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

Sidebar

Related Questions

I have created custom posts and I want one page in my site to
I have created custom site column with type text and I included in one
I have created a custom ArrayAdapter to display data within ListView items from an
This post will be heavy on images. I have created a custom ArrayAdapter and
I have created custom cell in which there are n number of image views.
If have created a custom role within SqlServer which I added to the db__denydatareader
We have created custom listview by using the Base adapter. List view contains Text
I'm developing an Android 3.1 application. I have created my custom ArrayAdapter with an
I have several spinners that I have created a custom ArrayAdapter for so I
I have 2 custom ListView Created as item layout + ArrayAdapter + My own

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.