[android-developers] Re: Android Loading listview items from service results in hang

2009-05-24 Thread Isaac Waller
How would I delay the saved state application until I load the service then? LOADING is my android:empty view - I guess I could remove it... Thanks, Isaac Waller On May 23, 9:11 pm, Marco Nelissen marc...@android.com wrote: On Sat, May 23, 2009 at 8:27 PM, Isaac Waller ad...@isaacwaller.com

[android-developers] Re: Android Loading listview items from service results in hang

2009-05-24 Thread Mark Murphy
Isaac Waller wrote: No, what you are supposed to do, is not return from onCreate until you are ready to show your GUI. The notion that you should not return from onCreate until you are ready to show your GUI is simply incorrect. 1. There is nothing forcing you to construct your UI in

[android-developers] Re: Android Loading listview items from service results in hang

2009-05-24 Thread Isaac Waller
I have read that article before, it is very informative, but I do not see anything about retaining the scroll position. I know it has something to do with the saved instance state, but I do not know how to restore this at a certain time? Thanks, Isaac On May 24, 2:53 am, Mark Murphy

[android-developers] Re: Android Loading listview items from service results in hang

2009-05-23 Thread Mark Murphy
Isaac Waller wrote: In my Android application, I have a ListActivity. This ListActivity uses a SimpleAdapter that I fill with items from my service. So, in my code, I do: MySuperCoolService.Binder serviceBinder = null; private ServiceConnection serviceConnection = new ServiceConnection()

[android-developers] Re: Android Loading listview items from service results in hang

2009-05-23 Thread Isaac Waller
Move the now retrieve from service using binder and set list adapter into onServiceConnected() and get rid of the sleep() infinite loop. If I do this, then I lose the benefits of running it in the UI thread. I want to hang my application until it gets these items, because if not, my view with

[android-developers] Re: Android Loading listview items from service results in hang

2009-05-23 Thread Marco Nelissen
On Sat, May 23, 2009 at 5:51 PM, Isaac Waller ad...@isaacwaller.com wrote: Move the now retrieve from service using binder and set list adapter into onServiceConnected() and get rid of the sleep() infinite loop. If I do this, then I lose the benefits of running it in the UI thread. I want

[android-developers] Re: Android Loading listview items from service results in hang

2009-05-23 Thread Isaac Waller
Even if I changed that, I would lose the saved list scroll position and selected item. I do not want to make some hack around running it in the UI thread - I want to hang the UI thread. On May 23, 8:06 pm, Jason Proctor ja...@particularplace.com wrote: If I do this, then I lose the benefits of

[android-developers] Re: Android Loading listview items from service results in hang

2009-05-23 Thread Marco Nelissen
hanging the UI thread is the hack. I suggest you do it the right way instead. On Sat, May 23, 2009 at 8:09 PM, Isaac Waller ad...@isaacwaller.com wrote: Even if I changed that, I would lose the saved list scroll position and selected item. I do not want to make some hack around running it in

[android-developers] Re: Android Loading listview items from service results in hang

2009-05-23 Thread Isaac Waller
No, what you are supposed to do, is not return from onCreate until you are ready to show your GUI. I am not ready without these items. If it took, say, 2 or 3 seconds to load these items, maybe, but it takes a fraction of a second - the screen flashes 'LOADING' and then shows the items. It looks

[android-developers] Re: Android Loading listview items from service results in hang

2009-05-23 Thread Marco Nelissen
On Sat, May 23, 2009 at 8:27 PM, Isaac Waller ad...@isaacwaller.com wrote: No, what you are supposed to do, is not return from onCreate until you are ready to show your GUI. I am not ready without these items. If it took, say, 2 or 3 seconds to load these items, maybe, but it takes a