-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,8 +27,10 @@ | |
import android.view.MenuItem; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.AdapterView; | ||
import android.widget.ArrayAdapter; | ||
import android.widget.ListView; | ||
import android.widget.Toast; | ||
|
||
import org.json.JSONArray; | ||
import org.json.JSONException; | ||
|
@@ -112,6 +114,14 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, | |
// Get a reference to the ListView, and attach this adapter to it. | ||
ListView listView = (ListView) rootView.findViewById(R.id.listview_forecast); | ||
listView.setAdapter(mForecastAdapter); | ||
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { | ||
|
||
@Override | ||
public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) { | ||
String forecast = mForecastAdapter.getItem(position); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
tolbxela
|
||
Toast.makeText(getActivity(), forecast, Toast.LENGTH_SHORT).show(); | ||
} | ||
}); | ||
|
||
return rootView; | ||
} | ||
|
Why don't we use adapterView here?
Or am I missing anything?
Thank you in advance.