public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.FragmentView, null); listView = view.FindViewById<GridView>(Resource.Id.listView); typename = Arguments.GetString("typename"); view.FindViewById<TextView>(Resource.Id.toptype).Text = typename; GetTypeList(); adapter = new MyAdapter(Activity, list); listView.Adapter = adapter; listView.ItemClick += ListView_ItemClick; ; return view; }
private void DownloadImages(object state) { var client = new WebClient(); foreach (var uri in images_to_fetch) { var bytes = client.DownloadData(uri); var bitmap = BitmapFactory.DecodeByteArray(bytes, 0, bytes.Length); // ReuseBitmapDrawableCache is threadsafe image_cache.Add(new Uri(uri), new SelfDisposingBitmapDrawable(Resources, bitmap)); } main_thread_handler.Post(() => { FindViewById<ProgressBar>(Resource.Id.progress).Visibility = ViewStates.Gone; grid_view = FindViewById<GridView>(Resource.Id.grid); grid_view.Adapter = new ImageAdapter(this); }); }