Ejemplo n.º 1
0
        protected async void t_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            timer.Stop();

            var intent = new Android.Content.Intent(this, typeof(MainActivity));

            if (this.Intent.Extras != null)
            {
                intent.PutExtras(this.Intent.Extras);
            }

            StartActivity(intent);
            OverridePendingTransition(Android.Resource.Animation.SlideInLeft, Android.Resource.Animation.SlideOutRight);
        }
Ejemplo n.º 2
0
        void ListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            if (e == null)
            {
                return;
            }

            var selectedBook = bookList[e.Position];
            var intent       = new Android.Content.Intent(this, typeof(DetailsActivity));

            Bundle bundle = new Bundle();

            bundle.PutString("book_name", selectedBook.Name);
            bundle.PutInt("book_image", selectedBook.ImageId);

            intent.PutExtras(bundle);

            StartActivity(intent);
        }
Ejemplo n.º 3
0
        private void OnListClicked(object sender, int position)
        {
            var intent = new Android.Content.Intent(Activity, typeof(ViewMovieActivity));

            CollectionItemList selected = (CollectionItemList)((ListView)sender).Adapter.GetItem(position);

            Bundle bundle = new Bundle();

            bundle.PutParcelable(ViewMovieActivity.ARG_USER, ((MainUserActivity)Activity).LoggedIn);
            bundle.PutInt(ViewMovieActivity.ARG_MOVIE, selected.MovieID);

            // set user collection list parcelable
            List <IParcelable> parcelList = new List <IParcelable>();

            foreach (Collection item in ((MainUserActivity)Activity).UserCollection)
            {
                parcelList.Add(item.ToBundle());
            }
            bundle.PutParcelableArrayList(ViewMovieActivity.ARG_COLLECTION, parcelList);

            intent.PutExtras(bundle);

            StartActivity(intent);
        }