コード例 #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.destinationLayout);
            // Create your application here
            listView = FindViewById <ListView>(Resource.Id.listView1);
            CityClass c1 = new CityClass("Venice", Resource.Drawable.venice2);
            CityClass c2 = new CityClass("Berlin", Resource.Drawable.berlin2);
            CityClass c3 = new CityClass("Tokyo", Resource.Drawable.tokyo2);

            cc.Add(c1);
            cc.Add(c2);
            cc.Add(c3);
            listView.Adapter    = new MyAdapter(this, cc);
            listView.ItemClick += OnListItemClick;
        }
コード例 #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.visitedLayout);
            // Create your application here
            listView = FindViewById <ListView>(Resource.Id.listView1);
            CityClass c1 = new CityClass("Beijing", Resource.Drawable.beijing);
            CityClass c2 = new CityClass("Rome", Resource.Drawable.roma2);
            CityClass c3 = new CityClass("Paris", Resource.Drawable.paris2);

            cc.Add(c1);
            cc.Add(c2);
            cc.Add(c3);
            listView.Adapter    = new MyAdapter(this, cc);
            listView.ItemClick += OnListItemClick;
        }