my dog learned polymorphism*
The moose likes Android and the fly likes Dynamically replacing Fragments Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Dynamically replacing Fragments" Watch "Dynamically replacing Fragments" New topic

Dynamically replacing Fragments

Stephen Tret

Joined: Feb 03, 2011
Posts: 17
I am trying to replace fragment1 with fragment3 by clicking on a 'Change Fragment' Button defined in fragmen2. Fragment3 will not fully replace Fragment1 completely. Instead it lines itself up underneath the text in Fragment1. I am doing something silly and I could use some pointers. I have included the code here and the output error screenshot (the gray area fragment3 doesn't completely overlay the white area fragment1). Thanks for any pointers.

Code for main.xml:

Code for fragment1:

Code for fragment3:

Code for fragment2:

Java Code behind 'Change Fragment' in fragment2:

[Thumbnail for screenshot.jpg]

I agree. Here's the link:
subject: Dynamically replacing Fragments
Similar Threads
TabHost repeating tab content
Layouts, bottom position
when i change android:orientation to horizontal it shows blank screen
Hashmap in android
how to put button inside a SurfaceView and on the bootom of the screen?