dynamically add view to view flipper

by Andy Droid » Sat, 05 Sep 2009 09:38:57 GMT

Sponsored Links
 Trying to dynamically add a view to a ViewFlipper.  I want to extend
ViewFlipper so I can modify it.  Here is the code.  The child does get
added, but it doesn't show up.  Any ideas?  thanks

public class DCMFlipper extends ViewFlipper {

        DCMFlipper(Context context){
                TextView tv = new TextView(context);
                tv.setLayoutParams(new ViewGroup.LayoutParams
                tv.setText("THIS IS A TEST");

dynamically add view to view flipper

by nimph » Sat, 05 Sep 2009 09:50:52 GMT

 Something like this should do it:

     setDisplayedChild(getDisplayedChild() + 1);



Sponsored Links

Other Threads

1. feature/application idea

What I'd really like is to see the text of each entry in the week view
of the Calendar - ar possibly a new application just for this...

I don't ever use timed entries - preferring to use my own way of
entering appointments. (does anyone else hate the way google tries to
help us by reading and 'interpreting' the time of our entries?! I wish
this could be switched off . In fact i'd love an option to make
everything an 'all day event' by default)

The old Psion organiser had this feature from the early 90's. Its week
view emulated the look of a filofax just opened out. Was perfect! And
it was easy to fast forward while reading the text...No calendar
application that I have seen has look like that ever since...

anyone else think like me?

BTW, totally in LOVE with my G1 - even after a whole week!



2. 2D over 3D


I am porting an application based on the sdk 3.0, and I am having
countless problems...

now, I am struggling trying to put 2D graphics on top of a 3D scene...

After a lot of headache, I managed to create a opengl context, which
now works, but when I try to put 2D graphics on top of it, this is
what happens:

public void drawFrame(GL10 gl)
                //view is a SurfaceView, and the value is not null !

                Canvas c=mySurfaceHolder.lockCanvas();

                //this is where I wanted to place my 2D drawing, but
after the above line, this is
                //what I got in the Log:
//11-20 12:52:02.508: ERROR/SurfaceComposerClient(490): eLocked set
when entering lock_layer(), //layer=1 (lcblk=0x410420a0),
//11-20 12:52:02.598: ERROR/SurfaceHolder(490): Exception locking


Any help would be very appreciated



3. About porting of bionin libc

4. One Year Contract with T-Mobile?

5. Retrieve phone number for given contact

6. Problems with PPP on Android - Omapzoom

7. Text Msg. Ring Tone.