为何listview 显示不出来内容
我从asp.net webservice获取arrylist数据
在后台代码中得到数据并绑定到listview,但是显示出来的是一串字符串,不知道为什么,大神们帮忙看看。谢谢
public class voteporformance extends Activity 主要代码:
rating.java 代码
在后台代码中得到数据并绑定到listview,但是显示出来的是一串字符串,不知道为什么,大神们帮忙看看。谢谢
public class voteporformance extends Activity 主要代码:
if (envelope.getResponse()!= null){
SoapObject result=(SoapObject) envelope.bodyIn;
SoapObject detail=(SoapObject) result.getProperty(methodName+"Result");
list= new ArrayList<rating>();
for (int i = 0; i < detail.getPropertyCount(); i++) {
SoapObject mstr=(SoapObject)detail.getProperty(i);
rating a = new rating();
String plusreason = mstr.getProperty("Plusreason").toString();
String average = mstr.getProperty("Average").toString();
String plusdepart = mstr.getProperty("Plusdepart").toString();
String lessdepart = mstr.getProperty("Lessdepart").toString();
String lessreason = mstr.getProperty("Lessreason").toString();
String branchName = mstr.getProperty("Branchname").toString();
String ratingmonth = mstr.getProperty("Datetime").toString();
a.setPlusreason(plusreason);
a.setAverage(average);
a.setPlusdepart(plusdepart);
a.setLessdepart(lessdepart);
a.setLessreason(lessreason);
a.setBranchName(branchName);
a.setRatingmonth(ratingmonth);
list.add(a);
}
Toast.makeText(voteporformance.this,
getString(R.string.Average),
Toast.LENGTH_SHORT).show();
ArrayAdapter<rating> adapter = new ArrayAdapter<rating>(this,R.layout.list_items,list);
mylListView.setAdapter(adapter);
}
rating.java 代码
public class rating {
private String plusreason;
private String Average;
private String plusdepart;
private String lessdepart;
private String lessreason;
private String branchName;
private String ratingmonth;
public String getPlusreason() {
return plusreason;
}
public void setPlusreason(String plusreason) {
this.plusreason = plusreason;
}
public String getPlusdepart() {
return plusdepart;
}
public void setPlusdepart(String plusdepart) {
this.plusdepart = plusdepart;
}
public String getAverage() {
return Average;
}
public void setAverage(String average) {
Average = average;
}
public String getLessdepart() {
return lessdepart;
}
public void setLessdepart(String lessdepart) {
this.lessdepart = lessdepart;
}
public String getLessreason() {
return lessreason;
}
public void setLessreason(String lessreason) {
this.lessreason = lessreason;
}
public String getBranchName() {
return branchName;
}
public void setBranchName(String branchName) {
this.branchName = branchName;
}
public String getRatingmonth() {
return ratingmonth;
}
public void setRatingmonth(String ratingmonth) {
this.ratingmonth = ratingmonth;
}
}
...全文
相关推荐
Android解决ScrollView下嵌套ListView和GridView中内容显示不全的问题
今天小编就为大家分享一篇关于Android解决ScrollView下嵌套ListView和GridView中内容显示不全的问题,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,需要的朋友一起跟随小编来看看吧
ScrollView GradView ListView 嵌套滑动冲突、item内容显示不全
结合自己开发的经历也参考其他人的解决方案,对 ScrollView GradView ListView 嵌套滑动冲突、item内容显示不全做的总结
ScrollView嵌套ListView,解决显示不全的问题
ScrollView嵌套ListView,解决显示不全的问题
[WPF]解决ListView在没有Items时,水平滚动条不出现的问题
[WPF]解决ListView在没有Items时,水平滚动条不出现的问题
解决scrollview嵌套listview显示不全的四种方法
重新测量listview高度,或者自定义listview


