Beispiel #1
0
        private void initTopBands()
        {
            topBandsListView = FindViewById <ListView> (Resource.Id.TopListView);
            topBandsList     = MusicoConnUtil.GetAllBandsAsync();

            topBandsList.Sort();



            int maxBands = 4;

            if (topBandsList.Count <= 4)
            {
                maxBands = topBandsList.Count - 1;
            }


            string[] items      = new string[maxBands + 1];
            int      startIndex = 0;

            for (int i = maxBands; i >= 0; i--)
            {
                items [startIndex] = topBandsList [i].Name;
                startIndex++;
            }

            CustomListAdapter listAdapter = new CustomListAdapter(this, items);

            topBandsListView.SetAdapter(listAdapter);
            topBandsListView.Clickable = true;

            topBandsListView.ItemClick += topBandClick_Click;
        }