Problem facing in customization of array adapter
I am want to
1) fetch data from a SQL server 2008
2) display fetched data into a list view.
After successfully I tried to display data with a listview, I fetched two column data that's why I tryed to customize my array adapter where is the code
public class testlistviewAdapter extends ArrayAdapter<String> {
public testlistviewAdapter(Context context, String[] foods) {
super(context, R.layout.testlistview,foods);
}
@Override
public View getView(int position,View convertView,ViewGroup parent ){
LayoutInflater joyinflater=LayoutInflater.from(getContext());
View customView=joyinflater.inflate(R.layout.listview_adapter_file,parent,false);
String singleFoodItem=getItem(position);
TextView firstrow=(TextView)customView.findViewById(R.id.tx);
TextView secondrow=(TextView)customView.findViewById(R.id.datetime);
firstrow.setText(singleFoodItem);
secondrow.setText(singleFoodItem);
return customView;
}
}
and here is the code from activity part
1 Answer(s)