public static MainFragment NewInstance(int someVar) { MainFragment fragment = new MainFragment(); Bundle args = new Bundle(); args.PutInt("someVar", someVar); fragment.Arguments = args; return(fragment); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Main); InitInstance(); if (bundle == null) { SupportFragmentManager.BeginTransaction() .Add(Resource.Id.contentContainer, MainFragment.NewInstance(0)) .Commit(); } }