views:

43

answers:

2

Hi guys,

Let me explain what I am want to archive. For example, in Flex I can create page (list of something) with 3 states: Loading state (just display some animation or label with text "Please wait."), No records state (page with text saying that there is no records) and Page with populated list. It is very easy to operate with states in Flex.

Is it possible to implement something similar in Android application? I would appreciate if you provide some examples.

A: 

Hi,

This is quite a big question you are asking... My way of doing that would be : to display your elements : - To use a ListView, in which you can define a state for "no element-empty list" And for the waiting screen, I would use a ViewSwitcher, you can find a good example to adapt here.

I hope this will help. Tell me if you need more explanations.

Sephy
A: 

Thanks Sephy for your reply and example. I don't really like "no element-empty list" solution, because this "empty" message will be visible during the phase of loading (when list yet is empty). I prefer completely separate states, maybe it is habit from Flex.
For case with two states, loading and populated list, ViewSwitcher is a perfect solution (ViewSwitcher can only have 2 states), but in my case I am going to have 3 states: loading, some message (no internet connection, incorrect credentials, ...) and list of data. I think it could be possible to implement using ViewFlipper. What you think about it?

barmaleikin