public override void onResume()
		{
			base.onResume();

			// Load from file "cities.json" first time
			if (mAdapter == null)
			{
				IList<City> cities = null;
				try
				{
					cities = loadCities();
				}
				catch (IOException e)
				{
					Console.WriteLine(e.ToString());
					Console.Write(e.StackTrace);
				}

				//This is the GridView adapter
				mAdapter = new CityAdapter(this);
				mAdapter.Data = cities;

				//This is the GridView which will display the list of cities
				mGridView = (GridView) findViewById(R.id.cities_list);
				mGridView.Adapter = mAdapter;
				mAdapter.notifyDataSetChanged();
				mGridView.invalidate();
			}
		}
Ejemplo n.º 2
0
        public override void onResume()
        {
            base.onResume();

            // Load from file "cities.json" first time
            if (mAdapter == null)
            {
                IList <City> cities = null;
                try
                {
                    cities = loadCities();
                }
                catch (IOException e)
                {
                    Console.WriteLine(e.ToString());
                    Console.Write(e.StackTrace);
                }

                //This is the GridView adapter
                mAdapter      = new CityAdapter(this);
                mAdapter.Data = cities;

                //This is the GridView which will display the list of cities
                mGridView         = (GridView)findViewById(R.id.cities_list);
                mGridView.Adapter = mAdapter;
                mAdapter.notifyDataSetChanged();
                mGridView.invalidate();
            }
        }