protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.PeopleLayout);

            var searchBar      = FindViewById <EditText>(Resource.Id.searchTxt);
            var searchBtn      = FindViewById <Button>(Resource.Id.searchBtn);
            var peopleListView = FindViewById <ListView>(Resource.Id.peopleListView);

            searchBtn.Click += async delegate
            {
                string queryString = "https://swapi.co/api/people/?search=" + searchBar.Text;
                var    data        = await DataServicePeople.GetStarWarsPeople(queryString);

                peopleListView.Adapter = new StarWarsPeopleAdapter(this, data.Results);
            };
        }
Exemple #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.People_Layout);

            var searchBar1     = FindViewById <EditText>(Resource.Id.searchEditText);
            var searchButton1  = FindViewById <Button>(Resource.Id.searchButton);
            var peopleListView = FindViewById <ListView>(Resource.Id.peopleListView);

            //var drawable = (int)typeof(Resource.Drawable).GetField("Luke_skywalker.jpg").GetValue(null);

            searchButton1.Click += async delegate
            {
                string searchWord  = searchBar1.Text;
                string queryString = "https://swapi.co/api/people/?search=" + searchWord;
                var    data        = await DataServicePeople.GetStarWarsPeople(queryString);

                peopleListView.Adapter = new StarWarsPeopleAdapter(this, data.Results);
            };
        }