public class myActivity extends Activity implements OnClickListener
{
private ListViewlistview_psychologicalstate,listview_weatherstate;
private ListAdapter listadapter_psychologicalstate,listadapter_weatherstate;
private ArrayList<String> psychologicalstatearray = new ArrayList<String>(),weatherstatearray = new ArrayList<String>();
private String [] strpsychologicalstate = new String[]{"郁闷","亢奋","压力","失眠","嗜睡","易惊恐"};
private String [] strweatherstate = new String[]{"湿热","燥热","寒冷"};
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.personalizedorderview);
findView();
}
public void findView()
{
listview_psychologicalstate = (ListView) findViewById(R.id.psychologicalstatelistid);
listview_weatherstate = (ListView) findViewById(R.id.weatherstatelistid);
for(int i = 0;i<strpsychologicalstate.length;i++)
psychologicalstatearray.add(strpsychologicalstate[i]);
for(int i = 0;i<strweatherstate.length;i++)
weatherstatearray.add(strweatherstate[i]);
listadapter_psychologicalstate = new GetinflamedAdapter(this,psychologicalstatearray);
listview_psychologicalstate.setAdapter(listadapter_psychologicalstate);
listadapter_weatherstate = new GetinflamedAdapter(this,weatherstatearray);
listview_weatherstate.setAdapter(listadapter_weatherstate);
}
public class GetinflamedAdapter extends BaseAdapter
{
private Context context;
private LayoutInflater mInflater;
private ArrayList<String> arraylist;
public GetinflamedAdapter(Context context,ArrayList<String> arraylist )
{
this.context=context;
this.arraylist = arraylist;
mInflater = (LayoutInflater) this.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@Override
public int getCount() {
// TODO Auto-generated method stub
return arraylist.size();
}
@Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return arraylist.get(position);
}
@Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
convertView = mInflater.inflate(R.layout.inflamedchild, null);
ViewHolder viewHolder = null;
viewHolder = new ViewHolder();
viewHolder.label = (TextView) convertView.findViewById(R.id.bodystateid1);
viewHolder.label.setText(arraylist.get(position).toString());
viewHolder.label.setTextColor(Color.GREEN);
viewHolder.label.setTextSize(22);
convertView.setTag(viewHolder);
return convertView;
}
private class ViewHolder
{
TextView label;
}
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有