Example #1
0
        public void OnItemSelected(Android.Net.Uri dateUri)
        {
            if (twoPane) {
                Bundle args = new Bundle ();
                args.PutParcelable (DetailFragment.DETAIL_URI, dateUri);

                DetailFragment fragment = new DetailFragment ();
                fragment.Arguments = args;

                FragmentManager.BeginTransaction ()
                         .Replace (Resource.Id.weather_detail_container, fragment, DETAILFRAGMENT_TAG)
                         .Commit ();
            } else {
                Intent intent = new Intent (this, typeof(DetailActivity))
                             .SetData (dateUri);
                StartActivity (intent);
            }
        }
Example #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate (savedInstanceState);
            RequestWindowFeature (WindowFeatures.ActionBar);
            SetContentView (Resource.Layout.activity_detail);
            ActionBar.SetDisplayHomeAsUpEnabled (true);
            ActionBar.SetDisplayShowHomeEnabled (true);
            ActionBar.SetIcon (Resource.Mipmap.ic_launcher);
            ActionBar.Title = "Details";
            if (savedInstanceState == null) {
                Bundle arguments = new Bundle ();
                arguments.PutParcelable (DetailFragment.DETAIL_URI, Intent.Data);

                DetailFragment fragment = new DetailFragment ();
                fragment.Arguments = arguments;

                FragmentTransaction fragTx = this.FragmentManager.BeginTransaction ();

                fragTx.Add (Resource.Id.weather_detail_container, fragment)
                    .Commit ();

            }
        }