It got ugly because after the first call it would crash so I added

        if (counter==0)
                setContentView(DeliveryDriver.newOrderViewGroup);
        else
                setContentView(R.layout.new_order);
        counter=1;

counter and DeliveryDriver.newOrderViewGroup are static.

This is really fugly! If anyone actually understands what is going on,
I would love an elegant solution.

On Feb 17, 3:29 pm, Marc <[email protected]> wrote:
> I may have found a solution. I put a call to
> getLayoutInflater().inflate(R.layout.new_order, null);
> and assign it to a static variable.
> right after the setContentView in the parent activity, and then in the
> slow one I pass my static view to setContntView
>
> My only problem is I dont understand why expanding the layout earlier
> is faster, my program does not seem to take a long time to load.
>
> On Feb 17, 2:59 pm, Marc <[email protected]> wrote:
>
>
>
> > I have an activity whos layout is made up of 3 viewFlippers and 4
> > views. The first the  time it loads setContentView takes about 8s to
> > load. After that each time the activity (which is a sub-activity) is
> > launched it only takes about 1 second.
>
> > Does anybody have some insight on this?
>
> > Presumably there is some caching going on. Maybe I could pre-expand
> > the layout on a background thread, or while a splash screen is
> > displayed at startup. Another possibility would be to pop up a please
> > wait dialog.

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

Reply via email to