2012/8/16 b0b <pujos.mich...@gmail.com>

>
>
> On Thursday, 16 August 2012 03:47:02 UTC+2, MagouyaWare wrote:
>
>> As for onCreate() you shouldn't really be doing ANYTHING except calling
>> setContentView() and initializing a few member variables.  Anything else
>> needs to go in a separate thread (perhaps using AsyncTask) to do heavy
>> initialization/work...
>>
>>
> Yes absolutely, using threading or lazy initalization when appropriate.
> onCreate(), onResume(), onStart() have to execute as fast as possible.  The
> only limiting factor here
> is is the time taken by loading layouts which cannot be easily reduced or
> reduced at all.
>

It seems that inflating views just isn't very fast, even with the binary
XML format and stuff.

I recently spent some time profiling my app's opening a ListView
containing... a list... of data items (duh).

On a Galaxy Nexus, there are about 7-8 of them fitting on the screen, each
having about 8-10 child views in a RelativeLayout.

The initial onLayout() takes about 150-200ms, which is very noticable. The
time spent in the layout inflater (called by getView, called during this
initial layout to make scrap views) is about 2/3 of that.

By comparison, the Gmail app's (just to pick an example) list rendering is
really fast -- but then each item in their message list is a sinlge Android
view.

-- K

-- 
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