Skip to content
This repository was archived by the owner on Jun 23, 2022. It is now read-only.

Commit 1d42493

Browse files
author
Lyla
committed
1.06 Hook the adapter up to the ListView
1 parent 0281f77 commit 1d42493

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/src/main/java/com/example/android/sunshine/app/MainActivity.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import android.view.View;
2525
import android.view.ViewGroup;
2626
import android.widget.ArrayAdapter;
27+
import android.widget.ListView;
2728
import java.util.ArrayList;
2829
import java.util.Arrays;
2930
import java.util.List;
@@ -101,6 +102,11 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
101102
weekForecast);
102103

103104
View rootView = inflater.inflate(R.layout.fragment_main, container, false);
105+
106+
// Get a reference to the ListView, and attach this adapter to it.
107+
ListView listView = (ListView) rootView.findViewById(R.id.listview_forecast);
108+
listView.setAdapter(mForecastAdapter);
109+
104110
return rootView;
105111
}
106112
}

0 commit comments

Comments
 (0)