首页 > 代码库 > ListView 上面用EditText 改变内容

ListView 上面用EditText 改变内容

holder.insure_account.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(final View view) {

 

AlertDialog builder = new AlertDialog.Builder(ctx)
.setTitle("参保账号")
.setView(editview).
setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {

holder.insure_account.setText(edit_view.getText().toString());
// 软键盘弹出收回之后,listview 会重新getView 重画界面,所以在这里改变数据源
try {
((JSONObject) getItem(position)).put("account",edit_view.getText().toString());
} catch (JSONException e) {
e.printStackTrace();
}
MyService.businessInsureList.get(position).setAccount(edit_view.getText().toString());
((ViewGroup) editview.getParent()).removeView(editview);
}
}).
create();

builder.show();
}
});

ListView 上面用EditText 改变内容