Ejemplo n.º 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.Inbox);

            ListView         listView    = FindViewById <ListView>(Resource.Id.lv_inbox);
            InboxListAdapter listAdapter = new InboxListAdapter(this);

            listView.Adapter    = listAdapter;
            listView.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs e)
            {
                InboxCampaign campaign = (InboxCampaign)listAdapter.GetItem(e.Position);
                campaign.Read = true;

                listAdapter.NotifyDataSetChanged();

                if (campaign.HasCreative)
                {
                    Intent intent = new Intent(this, typeof(InboxDetailActivity));
                    intent.PutExtra("campaign", campaign);
                    StartActivity(intent);
                }
            };

            listAdapter.GetData(null);
        }
Ejemplo n.º 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.InboxDetail);

            if (savedInstanceState == null)
            {
                InboxCampaign       campaign    = (InboxCampaign)Intent.GetParcelableExtra("campaign");
                InboxDetailFragment fragment    = InboxDetailFragment.NewInstance(campaign);
                FragmentTransaction transaction = FragmentManager.BeginTransaction();
                transaction.Add(Resource.Id.container, fragment);
                transaction.Commit();
            }
        }