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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:10:07+00:00 2026-06-15T07:10:07+00:00

I am working on an Android app which will support the Ice cream sandwich

  • 0

I am working on an Android app which will support the Ice cream sandwich API but work on older devices such as running android 2.1.

I’m doing this by doing a check of what the current API version is, and if its post ice cream sandwich call one activity and then if its anything below, call a different activity.

I am allowing the user to perform a search, when it gets the results it then clears ArrayList and then adds the items from the search back in, and then calls the arrayadapter.notifydatasetchanged. This code I’ve copied and pasted from the ICS version into the pre ICS version, the ICS works fine but on the pre ics version the list view doesn’t get updated. Below is the code that I have.

public void performSearch(ArrayList<Spanned> searchPasswords)
    {
        if (searchPasswords.size() > 0)
        {
            btnClearSearch.setVisibility(View.VISIBLE);
            passwords.clear();
            for (int i = 0; i < searchPasswords.size(); i++)
            {
                passwords.add(searchPasswords.get(i));
            }

            passwordArrayAdapter.notifyDataSetChanged();
            btnClearSearch.setOnClickListener(mBtnClearSearch);
            common.showToastMessage(searchPasswords.size() + " result(s) found", Toast.LENGTH_LONG);
        }
        else
        {
            common.showToastMessage("No search results found", Toast.LENGTH_LONG);
        }
    }

I’ve debugged this function so it is definetely calling it, and its displaying the toast messags with saying how many results were found, but the list view doesn’t get changed.

Update

I have just made a discovery which is a bit confusing. As a test in the function that does the initial loading of the list view I manually create a new search ArrayList<Spanned> and pass this to the same PerformSearch(ArrayList<Spanned>) that I am having the problem with and this works without any problems.

The problem with the performSearch not updating the ListView only seems to happen when it is being called from onActivityResult. I know that onActivityResult is working fine as when the performSearch function is called it then prints out there is 1 result(s) found so its definitely got data just the list view doesn’t get refreshed from the onActivityResult calling the performSearch function.

  • 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-15T07:10:09+00:00Added an answer on June 15, 2026 at 7:10 am

    Thanks everyone for your help and suggestions, I’ve managed to find out what the problem was.

    In my OnResume method for the activity I call a function called populateListArray which retrieves all of the information from the database and lists in the ListView.

    When the activity was returned it was calling the OnResume method so after it got the results it then reset the list view back with all the original content.

    To get round it I added a variable called performingSearch which I initialise to false. When I perform the search I set this to true and in the onResume, if the variable is true I don’t do anything and after the perform search function has finished I set the variable back to false again.

    Thanks everyone again for your help

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

Sidebar

Related Questions

I'm working on mobile (Android/iOS) app, which will integrate with FB and have a
I am working on an app which will be full-screen, but will utilize some
I'm developing an Android app which will target 2.1/2.2 devices, so I have my
I'm working on an Android app in which I would like to use multi-touch.
I have made an android app which working fine. I implemented the Login functionality
I am working on an android app that has a database in which one
I have an app which was tested thoroughly and working fine on Android Gingerbread
I have an Android app that I had working a few months ago which
I am working on a CRM app in android, in which, I am showing
I'm currently working on a app for a podcast (katg.com) which will let you

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.