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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:13:54+00:00 2026-06-13T07:13:54+00:00

I want to do nothing more than change the font Typeface and size of

  • 0

I want to do nothing more than change the font Typeface and size of my spinner text.

I have made some initial attempts. Nothing is crashing, but my spinner is blank. (I also have yet to implement the custom Typeface, I am just trying to get the spinner to work first.

In code:

protected SpinnerSortAdapter sAdapter;
    protected Spinner sort;
    protected String[] strings;

        sort = (Spinner) getActivity().findViewById(R.id.spinner2);
        strings = getActivity().getResources().getStringArray(R.array.sorting_items);
        SpinnerSortAdapter sAdapter = new SpinnerSortAdapter(getActivity(),
                android.R.layout.simple_spinner_item, strings);
        sAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        sort.setAdapter(sAdapter);
        sort.setOnItemSelectedListener(new MyOnItemSelectedListener());

Adapter:

public class SpinnerSortAdapter extends ArrayAdapter<String> {
public SpinnerSortAdapter(Context context, int textViewResourceId,
        String[] strings) {
    super(context, textViewResourceId, strings);
}

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    View view = super.getView(position, convertView, parent);
    if (view instanceof TextView) {
        ((TextView) view).setTextSize(5);
    }
    return view;
}

public View getDropDownView(int position, View convertView, ViewGroup parent) {
    View row = super.getView(position, convertView, parent);
    return (row);
}

}enter code here

  • 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-13T07:13:55+00:00Added an answer on June 13, 2026 at 7:13 am

    You’re not initializing the adapter correctly. Your version of ArrayAdapter that takes two ints, one pointing to a layout file for the row and an int representing the id of a TextView widget from that layout file. This adapter will be empty. Your code should be like this:

    String[] items = getResources().getStringArray(R.array.sorting_items);
    SpinnerSortAdapter adapter = new SpinnerSortAdapter(getActivity(), android.R.layout.simple_spinner_item, items);
    

    Also the adapter would be changed to:

     public class SpinnerSortAdapter extends ArrayAdapter<String> {
    
        public SpinnerSortAdapter(Context context, int textViewResourceId,
                String[] strings) {
            super(context, textViewResourceId, strings);
        }
    
        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            View view = super.getView(position, convertView, parent);
            if (view instanceof TextView) {
                ((TextView) view).setTextSize(5);
            }
            return view;
        }
    
        public View getDropDownView(int position, View convertView, ViewGroup parent) {
            View row = super.getView(position, convertView, parent);
            return (row);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to change the text in the Alert on timer tick, but nothing
I have looked at other post but nothing explained what I want to do
If i have two tables that have nothing in common I want to do
I've got a Silverlight applet whose UI consists of nothing more than a single
Summary I have a web-application with more than 5 themes. Each themes covers a
<html> <head> <style type=text/css> #sidebar p { font-family: Verdana; font-size: .9em; } #sidebar .intro
I want to change the text color of an element based on the element's
I want to return nothing when if condition is not met, for instance (if
The ListView shows nothing when I want to set the adapter to display the
I want to write a simple DSL in C#. Nothing too complicated. I'm looking

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.