2015-01-24 6 views
0

week_forecast 배열이 디자인에 나타나야하지만이 나타나는 내용을 발생하지 않은 요소 항목 1, 항목 2, 항목 3 인을 포함하는 배열의 요소를 볼 수 없습니다 ....안드로이드 목록보기,

public View onCreateView(LayoutInflater inflater, ViewGroup container, 
      Bundle savedInstanceState) { 
     View rootView = inflater.inflate(R.layout.fragment_my, container, false); 

     ArrayList<String> week_forecast = new ArrayList<String>(); 
     week_forecast.add("Today - Sunny - 88/630"); 
     week_forecast.add("Tomorrow - Foggy - 70/46"); 
     week_forecast.add("Weds - Cloudy - 72/63"); 
     week_forecast.add("Thurs - Rainy - 64/51"); 
     week_forecast.add("Fri - Foggy - 70/46"); 
     week_forecast.add("Sat - Sunny - 76/68"); 

     // initializing the adapter of the list of views 
     adapter = new ArrayAdapter<String>(getActivity(),R.layout.List_item_forecast,R.id.list_item_forecast_textview,week_forecast); 
     ListView listView = (ListView) rootView.findViewById(R.id.listview_forecast); 

     listView.setAdapter(adapter); 
     return rootView; 
    } 

* listview_forecast리스트 뷰와 주 단편의 ID는

* list_item_forecast는

가 list_item_forecast_textview *는 이전 프래그먼트의 ID 인 텍스트 뷰와 단편의 이름

,451,515,

답변

0

변경이

adapter = new ArrayAdapter<String>(getActivity(),R.layout.List_item_forecast,week_forecast); 

adapter = new ArrayAdapter<String>(getActivity(),R.layout.List_item_forecast,R.id.list_item_forecast_textview,week_forecast);