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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:23:17+00:00 2026-06-04T22:23:17+00:00

I have a spinner which is populated from the database. This in turn is

  • 0

I have a spinner which is populated from the database. This in turn is pulled from a webservice so it is not possible to hard-code the values.

The spinner is part of a form that the user fills out and saves and I need them to be able to go back in and edit the values, so I am trying to auto-populate it based on what was selected.

The problem is that the spinner does not always select, which happens more often than not. I think this is due to the fact that I am loading the data asynchronously using an asynctask, and by the time it retrieves the data the spinner has yet not been loaded. I have logging showing that, for example, spinner item 4 was pulled from the database, but the spinner shows nothing selected.

What is the best way to find out when the loader has been completed so that I can populate (ie select) the relevant item in the list?

  • 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-04T22:23:19+00:00Added an answer on June 4, 2026 at 10:23 pm

    I put the call at the end of the load finished method,

    @Override
        public void onLoadFinished(Loader<Cursor> aLoader, Cursor aCursor) {
            int id = aLoader.getId();
    
            Loader<Cursor> cursorLoader = null;
            switch (id) {
                mAdapter.swapCursor(aCursor);
            }
            if (inEditMode) {
                fillInValues();
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, at the moment I have a spinner which is populated from a database
I have one spinner in my project where values comes from database and displays
I have one spinner in which few values are there from strings.xml and I
I have a spinner which is populated from an Enum: public enum Frequencies {
i have an array which is populated in the spinner adapter. now i wanna
I have an application, which has a Spinner that I want populated with some
I have a spinner that show my data list from a database SQLite.. I
I have a listview which loads its data from sqlite database. Each row in
Hi i have an android spinner populated from and array that i want to
Hello I have question about android spinner I have spinner which is populated by

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.