1

这是我用于创建表和动态附加数据的代码:

table = (TableLayout)findViewById(R.id.table);    
inflater = getLayoutInflater();    

for(int i = 0; i < 5; i++) {    
    row = (TableRow)inflater.inflate(R.layout.row,table, false);    
    TextView text = (TextView)row.findViewById(R.id.text1);    
    text.setText("sss:" + i);     
    text1 = (EditText)row.findViewById(R.id.text2);
    text2 = (TextView)row.findViewById(R.id.text3);   
    text2.setText("");    
    text1.addTextChangedListener(new MyWatcher(text2));    
    table.addView(row);    
}    

此代码工作正常,但是当我单击按钮时出现问题。我想从每行中获取仅填充的值。

NxtBtn.setOnClickListener(new View.OnClickListener() {   
    public void onClick(View view) {    
    }  
});  

请帮我。

4

0 回答 0