我试图显示在每个文本区域上ping多个IP地址的结果。如果不连续执行ping(不带-t),则ping将显示首先选择的IP地址的渐进结果,而在后台ping其他地址。然后,它会在第一个完成ping操作后立即显示另一个的结果。下面是更新文本区域的代码。
@Override
public View getView(final int position, View convertView, final ViewGroup parent) {
final int pos = position;
if (inflater == null)
inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
ViewHolder holder;
if (convertView == null) {
convertView = inflater.inflate(R.layout.feed_item, null);
holder = new ViewHolder();
holder.name = (TextView) convertView.findViewById(R.id.name_book_display);
holder.timestamp = (TextView) convertView.findViewById(R.id.timestamp);
holder.statusMsg = (TextView) convertView.findViewById(R.id.desc_display);
convertView.setTag(holder);
}
else {
holder = (ViewHolder) convertView.getTag();
}
// This will help show the data properly
holder.name.setText("something")
holder.timestamp.setText("something")
holder.statusmsg.setText("something")
return convertView;
}
在此先感谢您的帮助。