public AdapterClass(Context a, int resourceID, List <Info> entries) {
super(a, resourceID, entries);
this.layoutResource = resourceID;
}
@
Override
public View getView(int position, View convertView, ViewGroup parent) {
final Object custom = getItem(position);
LinearLayout rowView = null;
if (convertView == null) {
rowView = new LinearLayout(getContext());
LayoutInflater vi = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
vi.inflate(layoutResource, rowView);
} else
rowView = (LinearLayout) convertView;
if (custom != null) {
}
return rowView;
}
런타임에 두 개의 다른 레이아웃을 전달할 때 getView()
메서드에서 전달할 레이아웃을 어떻게 식별 할 수 있습니까? ArrayAdapter
을 사용하고 있습니다.런타임에 listView에서 레이아웃을 확인하는 중
에 전달 된 부모 ID에 대해 점검 할 수 있어야한다을 전달 레이아웃 ID의 확인하기 위해 레이아웃을 사용할 수 있습니까? –
@ PankajKumar : 어떤 코드가 필요한지, 제가 그것을 어댑터에 전달하는 방식으로하고 싶습니다. – Kevin
@kevin 내 대답을 확인 –