File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Make it so: Java DB Connections & Transactions this week in the JDBC 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
It's not a secret anymore!