In continuation with the problem
Google Android tutorial - not compiling
The asList
used while creating weekForecast variable is giving an error -- cannot resolve method .. ? I have used these header files apart from above solutions and support.v4 as well.
Its not the complete program.
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;
public static class PlaceholderFragment extends Fragment{
public PlaceholderFragment(){
}
public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
View rootView= inflater.inflate(R.layout.fragment_main,container);
String[] forecastArray = {
"Today - Sunny - 88/63",
"Tomorrow - Foggy - 70/40",
"Weds - Cloudy - 72/63",
"Thurs - Asteroids - 75/65",
"Fri - Heavy Rain - 65/56",
"Sat - HELP TRAPPED IN WEATHERSTATION - 60/51",
"Sun - Sunny - 80/68"
};
List<String> weekForecast = new ArrayList<String>(Array.**asList**(forecastArray));
ArrayAdapter mForecastAdapter = new ArrayAdapter<String>(getActivity(),R.layout.list_item_forecast,
R.id.list_item_forecast_textview,weekForecast);
ListView listView = (ListView) rootView.findViewById(R.id.listview_forecast);
listView.setAdapter(mForecastAdapter);
return rootView;
}
}