如何改变editext值从第一个到最后在Android的定制列表视图 [英] how to changed editext values from first to last in customise listview in android

查看:108
本文介绍了如何改变editext值从第一个到最后在Android的定制列表视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到menunames然后附加到自定义列表视图的EditText。现在我在的EditText改变一些价值观。我想与EditText上的改变值的所有值到数组

i am getting menunames from database then append to the custom listview edittext . now i am changing some values in edittext . i want all values with changed values of edittext into array

           Example :x,y,z menunames comes from database i append editext(Custom listview)
           now i am changed y to b 
           now i want x,b,z in arraylist 

我尝试这个code(基本适配器类)

i try this code(Base adapter class)

           public View getView(int position, View convertView, ViewGroup parent) {
    final ViewHolder holder;


    if (convertView == null) {
        holder = new ViewHolder();
        convertView = inflater.inflate(R.layout.editmainmenulist, null);
        holder.caption = (EditText) convertView
                .findViewById(R.id.editmaimenu);
        holder.caption1=(ImageView) convertView.findViewById(R.id.menuimage);
        convertView.setTag(holder);
    } else {
        holder = (ViewHolder) convertView.getTag();
    }
    //Fill EditText with the value you have in data source
    holder.caption.setText(itemnames[position]);
    holder.caption.setId(position);
    holder.caption1.setImageBitmap(bmps[position]);


    arr.add(holder.caption.getText().toString());//here i get menunames data only not changed edittext values



    return convertView;
}
  }

 class ViewHolder {
EditText caption;
ImageView caption1;
}

 class ListItem {
String caption;
 }

请帮我

推荐答案

如果新的数据已经被来自数据库,那么你必须再次调用光标&放大器;
setAdapter再次到ListView ..

if the new data has been come from database then you have to call the cursor again & setAdapter again to the listView..

如果这样你只是用来无效ListView中的数据已经在数组列表。
ñ重新设置适配器....
你会得到你想要的东西...

or if the data is already in the array list so you just used to invalidate the listView. n set the Adapter again.... you'll get what you want...

这篇关于如何改变editext值从第一个到最后在Android的定制列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆