protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); this._coffeeService = Microsoft.Practices.ServiceLocation.ServiceLocator.Current.GetInstance<ICoffeeService>(); Task.Run (async () => { await _coffeeService.InitializeAsync(); this.RunOnUiThread(() => { this.ListAdapter = _adapter = new CoffeeListAdapter(this, _coffeeService); }); }); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); this._coffeeService = Microsoft.Practices.ServiceLocation.ServiceLocator.Current.GetInstance <ICoffeeService>(); Task.Run(async() => { await _coffeeService.InitializeAsync(); this.RunOnUiThread(() => { this.ListAdapter = _adapter = new CoffeeListAdapter(this, _coffeeService); }); }); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.CoffeeListFragment, null); var listView = view.FindViewById <ListView>(Resource.Id.coffee_listview); this._coffeeService = Microsoft.Practices.ServiceLocation.ServiceLocator.Current.GetInstance <ICoffeeService>(); Task.Run(async() => { await _coffeeService.InitializeAsync(); Activity.RunOnUiThread(() => { listView.Adapter = _adapter = new CoffeeListAdapter(Activity, _coffeeService); }); }); listView.ItemClick += ListView_ItemClick; return(view); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.CoffeeListFragment, null); var listView = view.FindViewById<ListView>(Resource.Id.coffee_listview); this._coffeeService = Microsoft.Practices.ServiceLocation.ServiceLocator.Current.GetInstance<ICoffeeService>(); Task.Run(async () => { await _coffeeService.InitializeAsync(); Activity.RunOnUiThread(() => { listView.Adapter = _adapter = new CoffeeListAdapter(Activity, _coffeeService); }); }); listView.ItemClick += ListView_ItemClick; return view; }