How can I use a ViewFlipper correctly?
A have a layout file, with a ViewFlipper. I included 7 layouts in there.
Using this code:
mFlipper = (ViewFlipper) ((Activity) mycontext).findViewById(R.id.flipper);
mFlipper.setInAnimation(AnimationUtils.loadAnimation(mycontext, R.anim.slide_left_in));
mFlipper.setOutAnimation(AnimationUtils.loadAnimation(mycontext, R.anim.slide_left_out));
mFlipper.setDrawingCacheEnabled(true);
and then:
mFlipper.setDisplayedChild(viewID);
but it is very slow, and laggy. sometimes it runs fast, but more time it is laggy and slow. why?
update: all of my layout’s background picture is a big texture background with FILL_PARENT and transparent png.
Probably because
Try to remove that background image from all those inner layouts and set it to the root one (
ViewFlipper?).