Issue navigating to a Fragment
-
Good Day All i have a Navigation Drawer which is defined like this
and when one of my drawer item is selected i have this code
// Create a new fragment and a transaction.
FragmentTransaction fragmentTx = this.FragmentManager.BeginTransaction();
Fragment1 aDifferentDetailsFrag = new Fragment1();
// The fragment will have the ID of Resource.Id.fragment_container.
fragmentTx.Add(Resource.Id.content_frame, aDifferentDetailsFrag);// Commit the transaction. fragmentTx.Commit(); Toast.MakeText(this, "Home:", ToastLength.Long).Show();
and Fragment1 is defined like this
and the cs is defined like this
public class Fragment1 : Fragment
{public override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your fragment here } public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.Inflate(Resource.Layout.Fragment1, null, false); } }
when i run this , i only get a toast message, the Fragment1 does not show which has a button that is having text "home" Thanks
Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vimalsoft.com vuyiswa[at]vimalsoft.com