/// <summary> /// Called when [create]. /// </summary> /// <param name="bundle">The bundle.</param> protected override void OnCreate(Bundle bundle) { // Check if _handler has Categories and Businesses initialized ErrorCheckActivity.checkXMLHandlerInitialization(this.ApplicationContext, _handler.isInitialized); base.OnCreate(bundle); SetContentView(Resource.Layout.ListBusiness); // Set the toolbar var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); SupportActionBar.Title = Intent.GetStringExtra("subcategoryName") ?? this.ApplicationContext.GetString(Resource.String.ApplicationName); // Get Views _ListView = FindViewById <ListView>(Resource.Id.lvListArea); // Get the passed categoryName _categoryName = Intent.GetStringExtra("categoryName") ?? "No Data Found"; _subcategoryName = Intent.GetStringExtra("subcategoryName") ?? "No Data Found"; // Get unique List of all possible Businesses for the given categoryName & subcategoryName GetBusinessList(_categoryName, _subcategoryName); // Set the custom adapter BusinessListAdapter adapter = new BusinessListAdapter(this, _businessList); _ListView.Adapter = adapter; // Events ... _ListView.ItemClick += _ListView_ItemClick; }
/// <summary> /// Called when [create]. /// </summary> /// <param name="bundle">The bundle.</param> protected override void OnCreate(Bundle bundle) { // Check if _handler has Categories and Businesses initialized ErrorCheckActivity.checkXMLHandlerInitialization(this.ApplicationContext, _handler.isInitialized); base.OnCreate(bundle); SetContentView(Resource.Layout.ListBusiness); // Set the toolbar var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); SupportActionBar.Title = this.ApplicationContext.GetString(Resource.String.RecyclingInfoActivityLabel); // Getting Views _ListView = FindViewById <ListView>(Resource.Id.lvListArea); // Get unique List of all possible Businesses GetBusinessList(); // Set the custom adapter BusinessListAdapter adapter = new BusinessListAdapter(this, _businessList); _ListView.Adapter = adapter; // Set the ListView on-click function _ListView.ItemClick += _ListView_ItemClick; }
private async Task BusinessListLoad() { string json = JsonConvert.SerializeObject("{}"); try { JsonValue item = await service.GetServiceMethod(this, "GetBusinessTypeData", json).ConfigureAwait(false); result = JsonConvert.DeserializeObject <List <BusinessModel> >(item); if (result != null) { dba.insertBusinessTypeData(result); values = dba.getBusinessTypeData(); adapter = new BusinessListAdapter(this, values); businessListView.SetAdapter(adapter); } } catch (Exception ex) { } }