Last active
August 29, 2015 14:27
-
-
Save naanT/2ec4a7ce315d7c0090d6 to your computer and use it in GitHub Desktop.
ArrayAdapter populating ListView
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ListView forecastListView; | |
View view = inflater.inflate(R.layout.fragment_main, container, false); | |
String[] forecastData = {"Sunny", "Cloudy", "Warm", "Hot", "Cold"}; | |
List<String> forecastList = new ArrayList<String>(Arrays.asList(forecastData)); | |
forecastAdapter = new ArrayAdapter<String>(getActivity().getBaseContext(), | |
R.layout.list_item_forecast, R.id.list_item_forecast_textView, forecastList); | |
forecastListView = (ListView) view.findViewById(R.id.listView_forecast); | |
forecastListView.setAdapter(forecastAdapter); | |
return view; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment