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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:16:34+00:00 2026-05-19T03:16:34+00:00

i have a ListView with a custom Servizio object in every row. I’m using

  • 0

i have a ListView with a custom Servizio object in every row. I’m using SimpleAdapter for this and it’s ok.

The problem is that i can’t fill the spinner inside every Servizio. This code inside Servizio.java is causing my app to crash:

Spinner spinner = (Spinner) findViewById(R.id.spinner);

        int m = 3;//Integer.parseInt(camping.rulesList.getMaxPers().get(camping.tipSel));

        String[] array_spinner=new String[m];
        for (int indice = 0; indice < m; indice++)
        {
            if (indice == 0) array_spinner[indice] = String.format("%d persona", indice+1);
            else array_spinner[indice] = String.format("%d persone", indice+1);
        }

        ArrayAdapter<String> aa = new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_spinner_item, array_spinner);
        aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        spinner.setAdapter(aa);

The same code is working for a single spinner on the main activity… what am i missing?

Thanks! 😉

UPDATE: Here’s the Log… Maybe the problem is that “Attempted to add window with non-application token WindowToken”…

01-11 16:23:06.038:
WARN/dalvikvm(12582): threadid=1:
thread exiting with uncaught exception
(group=0x40028a00) 01-11 16:23:06.038:
WARN/WindowManager(103): Attempted to
add window with non-application token
WindowToken{44ac0100 token=null}.
Aborting. 01-11 16:23:06.058:
(…)

  • 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-19T03:16:35+00:00Added an answer on May 19, 2026 at 3:16 am

    Ok the problem was that i was using getApplicationContext() instead of this. And it didn’t work ’till i’ve deleted All the getApplicationContext() of the class.

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

Sidebar

Related Questions

I have a listview with custom rows and that extends SimpleAdapter. Each row consist
I have got ListView with a custom Adapter. Every row contains clickable buttons and
I have this ListView that displays a custom user control. The custom user control
I have a ListView control that is in FullRowSelect mode, MultiSelect off and using
I have a custom ListView that uses a custom ArrayAdapter (which basically just overrides
I have a ListView with a custom Adapter that extends ArrayAdapter. It's a ArrayAdapter
I have a listview with a custom arrayadapter that handles about 15 strings. The
So I have a custom ListView object. The list items have two textviews stacked
here's a problem that i've run into lately: I have a listview with a
I have a custom control template for a ListView that puts an extra line

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.