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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:53:41+00:00 2026-06-01T14:53:41+00:00

I have within a TabActivity a Spinner that will be generated dynamically. Just to

  • 0

I have within a TabActivity a Spinner that will be generated dynamically. Just to test, I did so manually:

Spinner sp_departure = (Spinner) findViewById(R.id.spinner_departure);

// This array will be generated through a database
String[] array_spinner = new String[2];
array_spinner[0] = "Departure 1";
array_spinner[1] = "Departure 2";

ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, array_spinner);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
sp_departure.setAdapter(adapter);

When I run the app looks ok since option selected is “Departure 1” but when I click to open the options I get some errors and the application is closed.

Any idea what could be wrong?

Thanks in advance.

– Update

This is what was generated by LogCat: http://pastebin.com/1QPKZdKB

  • 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-01T14:53:42+00:00Added an answer on June 1, 2026 at 2:53 pm

    Yes you might have set setContetView(R.layout.yourxml)…,

    Change it to :

    View viewToLoad = LayoutInflater.from(this.getParent()).inflate(R.layout.yourxm, null);
            this.setContentView(viewToLoad);
    

    and use

    ArrayAdapter<String> adapter = new ArrayAdapter<String>(getParent(), android.R.layout.simple_spinner_item, array_spinner);
    

    Try, it may helps you

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

Sidebar

Related Questions

I have within my Sql Server 2008 database a trigger which will run on
I have text within a paragraph tag that that fits snug on the bottom
I'm trying to assign a class that I have within the jQuery UI accordion
I have links within an iframe that are external, and I would like them
Within my application I have 20 or so ViewControllers and Xibs that the user
I have Listviews within layouts and I want the user to know that there
I have recently discovered that when I have pointers within a class, I need
I have a TabActivity that has three tabs. The fist tab is the problem.
Within a view I have a button that makes a call to a method
I have a within a form that contains other fields for the form. I

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.