我想在我的片段中加載列表視圖,並且適配器的問題是錯誤 - Cannot resolve constructor ArrayAdapter
。無法解析構造函數ArrayAdapter(Listview,fragment)
這是onCreateView
方法在我的課:
public class AndroidGUIModifier implements IMyComponentGUIModifier, IFragmentEvents {
@Override
public void onCreateView() {
tv1 = (TextView) fragment.findViewById("xtv1");
tv2 = (TextView) fragment.findViewById("xtv2");
lv=(ListView) fragment.findViewById("xdevices") ;
mydevices = new ArrayList<String>();
ArrayAdapter<String> adapter = new ArrayAdapter<String>(AndroidGUIModifier.this,android.R.layout.simple_list_item_1,mydevices);// the problem here : Cannot resolve constructor ArrayAdapter
lv.setAdapter(adapter);
}
}
我得到這個: 無法解析構造「ArrayAdapter(java.security.AccessControlContext,INT的java.util.List) –
你延長'Fragment'? –
公共類AndroidGUIModifier實現IMyComponentGUIModifier,IFragmentEvents { –