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 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 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 from an SQLDatabase using custom CursorAdaptor. I would like to
I have a Custom ListView with an imageview and 2 TextViews above each other
I have a ListView backed by a custom adapter based on a CursorAdapter. The
I have a ListView that allows the user to change the ViewBase through a
I have a ListView with a CheckBox as one of the columns, bound to
Im opening a ListActivity with an xml called list with a ListView named list.
I have defined style for TabWidget as below: <style name=MyTheme parent=@android:style/Theme.Light> <item name=android:tabWidgetStyle>@style/LightTabWidget</item> </style>
In our SL4 application built on Caliburn.Micro, we've come across a (another) memory leak.

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.