Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ViewFlipper vs AdapterViewFlipper

Tags:

android

Could someone explain the practical differences between ViewFlipper and AdapterViewFlipper. Including when to use one and not the other.

I have been using ViewFlipper for months now in a custom cursor adapter and I am beginning to think I used the wrong approach albeit it works.

like image 663
HGPB Avatar asked Feb 19 '13 17:02

HGPB


1 Answers

With ViewFlipper, you typically declare all children up front, and there is no recycling concept.

With AdapterViewFlipper, you use an Adapter, as you would with ListView, Spinner, etc., so the children are determined on the fly and the views representing the children can be recycled.

For small, static content, ViewFlipper is simpler. Also, AdapterViewFlipper was added in API Level 11 (IIRC) and therefore will not work on older versions on Android.

like image 70
CommonsWare Avatar answered Oct 29 '22 16:10

CommonsWare