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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:24:52+00:00 2026-06-15T15:24:52+00:00

Below is my code. But it shows it is not possible. Can someone please

  • 0

Below is my code. But it shows it is not possible. Can someone please suggest me how to set the arraylist to the spinner rather than setting simple array to the spinner.Below is my code.

ArrayList<String> categoryList = new ArrayList<String>();

//Here I have code to set string values to arraylist

//Below is the code where I am attempting to set the arraylist but it says “The constructor ArrayAdapter(new Runnable(){}, int, ArrayList) is undefined“

Spinner spinnerCategory = (Spinner)findViewById(R.id.spinnercategory);
                    ArrayAdapter<String> categoriesAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, categoryList);
  • 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-15T15:24:53+00:00Added an answer on June 15, 2026 at 3:24 pm

    Please use Context of activity as the first parameter of the ArrayAdapter, you can use

    ActivityName.this instead of this, where the ActivityName is the name of the activity class. It seems you are running this code, in some Runnable, or Thread class, so right now, this is the instance of a Runnable object.

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

Sidebar

Related Questions

Below code not work, but it's work fine for jsf1.2. Now the framework is
Can someone tell me what is going on with the code below: 'Variables at
I tried below code but as I run it gives a black screen image
How to Remove Badge from the tabbar item i had use below code but
I am newbie to C. I googled alot regarding the output of below code.But
I want to open an xlsx file, I have tried the below code,but neither
I am trying to port the code below to mootools 1.1 code but am
I have tried using the code below but it only display results in Chrome
I have code that looks more or less like the code below but it
I am trying to run the code below but it keeps locking up my

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.