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