• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Android Air App Checking List Properties (Empty??, Populated??)?!?

New Here ,
Oct 09, 2011 Oct 09, 2011

Copy link to clipboard

Copied

Hi,

I am currently developing an Android App using Flashbuilder (AIR) and I have some lists that I use in this app which are populated by web services. I am looking to make sure that each time my users go from View to View the lists dont keep repopulating by calling the web service again. At the moment this happens a lot and it is slowing down the app. I am using a "<s:List" with a "<s:AsyncListView" contained within it.

I really just need to know if there is an easy way to get my app to know that the list has already been populated by the Web Service and not to try and recall the Web Service again? As it would also be very good to show a message stating that "No Results Found" when the Web Service brings nothing back, I am using an Event Listener on the Web Service so I dont know weather this can be done on this. I did try the below which did not work:

getAllJResult.addEventListener(ResultEvent.RESULT, onResult);

protected function onResult (event:ResultEvent):void

            {

                if(event.result == null)

                {

                    trace("None Found");

                }

                busy.visible = false;               

            }

Thanks

Views

804

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 09, 2011 Oct 09, 2011

Copy link to clipboard

Copied

As far as I know, when you switch views, the view is destroyed when exitted and then re created when you open it again. You should probably store the data in an external static class, or set itemDestructionPolicy = "never" to never destroy the view on exit.

Hope this helps.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 09, 2011 Oct 09, 2011

Copy link to clipboard

Copied

I know that you can set these settings and gaving the data persistent isnt the issue as i know how to do this. I just want to know how to detect if a list is empty or populated within the app, any ideas?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 09, 2011 Oct 09, 2011

Copy link to clipboard

Copied

(list.dataProvider == null) ??

I suppose you have tried that as well.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 11, 2011 Oct 11, 2011

Copy link to clipboard

Copied

LATEST

Yes I have tried that and nothing, I find it strange that there is no way to detect an empty list as I want to display a message to the users if the list in empty. Any other ideas?? Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines