protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.PerformedCargoesMain); typeOfUser = int.Parse(AuthService.UserType); mListView = FindViewById <ListView>(Resource.Id.lstPcPerformed); LayoutInflater inflater = (LayoutInflater)this.GetSystemService(Context.LayoutInflaterService); View headerView = inflater.Inflate(Resource.Layout.CargoesHeader, null); TextView lblTextHeader = (TextView)headerView.FindViewById <TextView>(Resource.Id.lblChTitleList); lblTextHeader.SetText(Resource.String.PerformedCargoesTitle); View footerView = inflater.Inflate(Resource.Layout.CargoesFooter, null); PerformedCargoesAdapter adapter = new PerformedCargoesAdapter(this, mItems); mListView.AddHeaderView(headerView); mListView.AddFooterView(footerView); mListView.Adapter = adapter; //var texview = FindViewById<TextView>(Resource.Id.lblChTitleList); //texview.Text = "Cargas Realizadas"; btnVolver = FindViewById <Button>(Resource.Id.btnCfReturn); btnVolver.Click += delegate { Intent nextScreen = new Intent(this, typeof(MainHistoricalActivity)); StartActivity(nextScreen); }; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.PerformedCargoesMain); typeOfUser = int.Parse(AuthService.UserType); mListView = FindViewById <ListView>(Resource.Id.lstPcPerformed); var originValue = Intent.GetStringExtra("originValue"); var destinyValue = Intent.GetStringExtra("destinyValue"); var cargoTypeValue = Intent.GetStringExtra("cargoTypeValue"); var priceRangeValue = Intent.GetStringExtra("priceRangeValue"); LayoutInflater inflater = (LayoutInflater)this.GetSystemService(Context.LayoutInflaterService); View headerView = inflater.Inflate(Resource.Layout.CargoesHeader, null); TextView lblTextHeader = (TextView)headerView.FindViewById <TextView>(Resource.Id.lblChTitleList); lblTextHeader.SetText(typeOfUser == 1 ?Resource.String.PublishedTripTitle : Resource.String.PublishedCargoesTitle); View footerView = inflater.Inflate(Resource.Layout.CargoesFooter, null); var data = new DataModels.DataModels(); var mItems = GetTrips(originValue, destinyValue, cargoTypeValue, priceRangeValue); PerformedCargoesAdapter adapter = new PerformedCargoesAdapter(this, mItems); mListView.AddHeaderView(headerView); mListView.AddFooterView(footerView); mListView.Adapter = adapter; btnVolver = FindViewById <Button>(Resource.Id.btnCfReturn); lblName = FindViewById <TextView>(Resource.Id.txtPcUser); mListView.ItemClick += MListView_ItemClick; btnVolver.Click += delegate { Intent nextScreen = new Intent(this, typeof(SearchCargoesActivity)); StartActivity(nextScreen); }; }