Ok, Basically I have a ListView down the left populated by a string array. On the right I have a FrameLayout which I use for showing fragments in. I am creating and showing them from the activity not in the XML so I can swap them out later on.
I want to be able to create a fragment for each entry in the array using the array entry as the tag for the fragment. I also want it to only hide the fragment so I can still call functions specific to each fragment to add things/make changes to them while they are hidden. The problem I'm having is with the code below. If I create the fragments using FragmentTransaction's Replace it works as it should visually (Removing the old fragment and showing the new). But I cannot access replaced fragments by tag this way. Using FragmentTransaction's Show/Hide with Add to make them it gives me access code wise to what I want to do but (see second NewFrags() function) doesn't actually Hide the previous fragment when a new one is made. currFrag = tag; causes the App to crash so I can't keep track of which the last one was that was made. This only happens when I create lots of fragments at once this way. If I run the code without the currFrag = tag; then it creates all the frags but they are all shown at once overlapping. If I then go through the list using switchFrag(tag); it will eventually hide all the fragments apart from the current selected one. Anyone have any ideas on this? ---------CODE--------- ----Partial code of Activity1.cs -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/Fragments-problem-tp5664586p5664586.html Sent from the Mono for Android mailing list archive at Nabble.com. _______________________________________________ Monodroid mailing list [email protected] UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
