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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:47:24+00:00 2026-05-26T09:47:24+00:00

I have a spinner getting views from a custom base adapter. The problem is

  • 0

I have a spinner getting views from a custom base adapter. The problem is when the spinner is displayed the font colour ALWAYS seems like its disabled, whether it is disabled or not. I have searched and searched for the solution but couldn’t find any. It wasn’t like this when I developed for other platforms. Currently I am on android 3.1 honeycomb galaxy tab 10.1 . PLEASE. HELP! Thanks!!

It worked well when i use the simple spinner dropdown item for a single text display so everything looks like its messed up. part of the page looks normal and part of it looks disabled.

Adapter item view

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    android:padding="5dp" >
    <TextView
        android:id="@+id/lblEmployeeIdentifier"
        style="@style/FormText" />
    <TextView
        style="@style/FormText"
        android:text=" - " />
    <TextView
        android:id="@+id/lblEmployeeName"
        style="@style/FormText" />
</LinearLayout>

And the adapter code

public class EmployeeAdapter extends BaseAdapter 
{
Employee[] employee;
int role;
boolean allActive;

public EmployeeAdapter(int role, boolean allActive)
{
    this.role = role;
    this.allActive = allActive;
    refreshData();
}

private void refreshData()
{
    DatabaseAdapter databaseAdapter = MainApplication.getDatabaseAdapter();
    databaseAdapter.open();
    employee = databaseAdapter.getEmployeesByRole(role, allActive);
    databaseAdapter.close();
}

@Override
public void notifyDataSetChanged() {
    refreshData();
    super.notifyDataSetChanged();
}

@Override
public int getCount() {
    return employee.length;
}

@Override
public Employee getItem(int position) {
    return employee[position];
}

@Override
public long getItemId(int position) {
    return employee[position].getEmployeeId();
}

@Override
public View getView(int position , View convertView, ViewGroup parent) {
    View view;

    if (convertView != null)
    {
        view = convertView;
    }
    else
    {
        view = LayoutInflater.from(MainApplication.getContext()).inflate(R.layout.employee_adapter_view_1, null);
    }

    TextView lblIdentifier = (TextView)view.findViewById(R.id.lblEmployeeIdentifier);
    TextView lblName = (TextView)view.findViewById(R.id.lblEmployeeName);

    lblIdentifier.setText(employee[position].getEmployeeIdentifier());
    lblName.setText(employee[position].getFirstName() + " " + employee[position].getLastName());

    return view;
}
}
  • 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-26T09:47:24+00:00Added an answer on May 26, 2026 at 9:47 am

    Delete MainApplication.getContext() and use an Activity.

    Then, temporarily replace R.layout.employee_adapter_view_1 with android.R.layout.simple_spinner_item and adjust your TextView updates to match. If the Spinner now behaves properly, your problem is in your primary adapter layout (R.layout.employee_adapter_view_1).

    If by:

    when the spinner is displayed the font colour ALWAYS seems like its disabled

    you mean that when the Spinner is opened (via the drop-down arrow) the entries in the list appear disabled, then the problem is with the layout you are using in your missing getDropDownView() implementation in EmployeeAdapter.

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

Sidebar

Related Questions

I am trying hard to have a Spinner look like Textview meaning the displayed
having a little problem getting the information from my spinner, this is how i
I have set a value in spinner , from activity-1. now i am traversing
I have a spinner set up like this: ArrayAdapter<String> states = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_dropdown_item,
I have a Spinner Control bind with data from Sqllite during the Page Load
I would like to have my spinner drop down just like a web form.
OK here is my problem. I have a spinner and every option in spinner
I have 2 spinner, each spinner's data loaded from database using AsyncTask i call
I have a spinner with items, populated via ArrayAdapter. I want to change font
I have a spinner. Now I want to compare the variable from the spinner

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.