Good Day All
i have a Navigation Drawer which is defined like this
Code:
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:background="#0099ff"
android:layout_height="fill_parent" />
and when one of my drawer item is selected i have this code
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
Code:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="12dp"
android:paddingRight="12dp">
<Button
android:textSize="24dp"
android:textColor="#FFF"
android:id="@+id/btn_details_file_save"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="HOME" />
</ScrollView>
and the cs is defined like this
Code:
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