/** * Create a new instance of DetailsFragment, initialized to * show the text at 'index'. */ public static DetailsFragment NewInstance(int index) { DetailsFragment f = new DetailsFragment(); // Supply index input as an argument. Bundle args = new Bundle(); args.PutInt("index", index); f.SetArguments(args); return(f); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); if (GetResources().GetConfiguration().Orientation == Configuration.ORIENTATION_LANDSCAPE) { // If the screen is now in landscape mode, we can show the // dialog in-line with the list so we don't need this activity. Finish(); return; } if (savedInstanceState == null) { // During initial setup, plug in the details fragment. DetailsFragment details = new DetailsFragment(); details.SetArguments(GetIntent().GetExtras()); GetSupportFragmentManager().BeginTransaction().Add( global::Android.R.Id.Content, details).Commit(); } }
/** * Create a new instance of DetailsFragment, initialized to * show the text at 'index'. */ public static DetailsFragment NewInstance(int index) { DetailsFragment f = new DetailsFragment(); // Supply index input as an argument. Bundle args = new Bundle(); args.PutInt("index", index); f.SetArguments(args); return f; }