我做了一个程序,在我的程序中,我有一个editText
. 我怎样才能获得我的价值edittext
......请帮助我,我无法获得excellent.getText().toString();
。
有没有办法获得我的编辑文本的价值?帮助我请提前谢谢你..
这是我的代码..
TableLayout table = new TableLayout(getApplicationContext());
table.setVerticalScrollBarEnabled(true);
table.setPadding(10, 10, 10, 10);
TableRow tableRow = new TableRow(getApplicationContext());
TextView txt = new TextView(getApplicationContext());
tableRow.addView(txt);
tableRow.setBackgroundColor(Color.GRAY);
txt.setText("Excellent ");
table.addView(tableRow);
int j = 0;
for (j = 1; j <= count; j++) {
TableRow tableRow2 = new TableRow(getApplicationContext());
EditText excellent = new EditText(getApplicationContext());
tableRow2.addView(excellent);
}
TableRow tableRow1 = new TableRow(getApplicationContext());
Button showtable = new Button(getApplicationContext());
tableRow1.addView(showtable);
showtable.setText("Show Table");
showtable.setTextSize(8);
showtable.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
excellent.getText().toString();// i cant get the value of
// excellent here!
}
});