More detail on this technique here: http://android-developers.blogspot.com/2009/03/window-backgrounds-ui-speed.html
On Mon, May 4, 2009 at 3:39 PM, Dianne Hackborn <hack...@android.com> wrote: > You can also do the trick maps does, where your activity's theme has the > background set to some image that is to be shown during startup, and in > onCreate() you programmatically set the background to whatever you really > want. Then the preview window that is shown for the activity has your > starting background. With careful use of padding in a 9-patch, you can > easily do centering of a logo... or use other drawables for some more > complicated effects. > > The down-side to this is that the preview window is currently only shown > when launching an activity as a new task (such as from home); if your > activity is launched from another activity in the same task, it won't be > shown. But if your activity is being used that way you should even more > work on optimizing its startup, since this is really going to be annoying > for users. > > Speaking of which there should be NO need to do more than a few seconds of > work on the main UI thread (and really our goal should be to keep this work > < 1 second). If you are taking long enough that you actually need to show > the user a "loading please wait" image, you are also probably flirting > dangeriously close to ANRing on the user. > > On Mon, May 4, 2009 at 2:34 PM, Marco Nelissen <marc...@android.com> wrote: >> >> Why not set your content view to be an ImageView with the desired image, >> and then once you're ready to show the real UI, call setContentView() again >> with the real UI? >> >> >> >> On Mon, May 4, 2009 at 2:22 PM, GiladH <gila...@gmail.com> wrote: >>> >>> Tnx but that is not what I'm looking for. >>> I basically want to display an image (packed within form/view/ >>> whatever) WITHOUT blocking the UI thread, >>> >>> Can this be done? >>> >>> >>> >>> >>> >>> >>> On May 4, 8:16 pm, Jeff Sharkey <jshar...@android.com> wrote: >>> > Take a peek at AsyncTask, it can help you easily (and correctly) >>> > transition between UI and background threads: >>> > >>> > http://d.android.com/reference/android/os/AsyncTask.html >>> > >>> > j >>> > >>> > >>> > >>> > On Mon, May 4, 2009 at 10:02 AM,GiladH<gila...@gmail.com> wrote: >>> > >>> > > Hey, >>> > >>> > > I want to display a fancy 'loading' image at my app's startup time. >>> > >>> > > The problem: my startup code is mostly GUI related, hence needs to >>> > > run >>> > > on UI thread. >>> > >>> > > Is there a way to do both - that is run UI-related code on UI thread >>> > > while an image >>> > > is displayed to the user? >>> > >>> > >GiladH >>> > >>> > -- >>> > Jeff Sharkey >>> > jshar...@google.com >>> >> >> >> > > > > -- > Dianne Hackborn > Android framework engineer > hack...@android.com > > Note: please don't send private questions to me, as I don't have time to > provide private support, and so won't reply to such e-mails. All such > questions should be posted on public forums, where I and others can see and > answer them. > > > > > -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---