Mark Murphy wrote:
> Brian Conrad wrote:
>   
>> I have an application that initializes a bunch of strings on startup.  
>>     
>
> Hopefully, in a background thread.
>
>   
>> Apparently none of these things will work until the 
>> layout is displayed? 
>>     
>
> More precisely, none of these things will display if you are hogging the
> UI thread.
>
>   
>> What workarounds are there?
>>     
>
> You have not indicated where the strings are stored (resources?
> literally in the layout? XML file? plain text file? database column?
> fetched from the Internet? randomly generated based on device orientation?).
>
> Generally speaking, when things take a while, you want to cause the "a
> while" to happen in a background thread, possibly using a progress bar
> or animation or something if the UI is not terribly useful until the
> background work is complete.
>
> If you could be a bit more specific on how you are trying to load
> strings today that is causing such a slowdown, we might be able to give
> more specific advice.
To be even more precise it is one string with carriage returns.  The 
data is calculated by the program.  The layout is in XML and handling 
the interface programmatically won't make a difference.  This only takes 
4-5 seconds but I still want a some kind of indicator of that.   This 
string is part of the main display about 40 rows worth so we have to 
wait for them.  I'll play around with some threads though and see what 
happens.  Thanks.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to