ArrayのDimensional EditTextを動的に作成しています。そして、私は1 EditTextの価値を取得し、別のEditTextに設定したいと思います。それはEditTextの値を設定すること(EditText [2] [2] .setText(ss);)に関して私に例外を与えます。は、EditTextの値を設定してExceptionを返します
final EditText editText[][] = new EditText[row_size][col_size];
for(int i=0;i<row_size;i++){
TableRow row = new TableRow(this);
a=i;
for(int j=0;j<col_size;j++){
final int i_count=i;
final int j_count=j;
id++;
editText[i][j] = new EditText(this);
allEds.add(editText[i][j]);
editText[i][j].setId(id);
hold_ids.add(editText[i][j].getId());
editText[i][j].setWidth(90);
editText[i][j].addTextChangedListener(new TextWatcher() {
public void onTextChanged(CharSequence s, int start, int before, int count){}
public void beforeTextChanged(CharSequence s, int start, int count,int after) {}
@Override
public void afterTextChanged(Editable s) {
ss=editText[i_count][j_count].getText().toString();
editText[2][2].setText(ss);
}
});
Logcatエラー::
03-30 17:28:27.695: E/AndroidRuntime(341): FATAL EXCEPTION: main
03-30 17:28:27.695: E/AndroidRuntime(341): java.lang.StackOverflowError
03-30 17:28:27.695: E/AndroidRuntime(341): at android.text.DynamicLayout.reflow(DynamicLayout.java:261)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.text.DynamicLayout.<init>(DynamicLayout.java:150)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.makeNewLayout(TextView.java:4993)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.checkForRelayout(TextView.java:5491)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2724)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2592)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.EditText.setText(EditText.java:78)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2567)
03-30 17:28:27.695: E/AndroidRuntime(341): at project.Excel.AndroidProjectActivity$1.afterTextChanged(AndroidProjectActivity.java:107)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.sendAfterTextChanged(TextView.java:6309)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2731)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2592)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.EditText.setText(EditText.java:78)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2567)
03-30 17:28:27.695: E/AndroidRuntime(341): at project.Excel.AndroidProjectActivity$1.afterTextChanged(AndroidProjectActivity.java:107)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.sendAfterTextChanged(TextView.java:6309)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2731)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2592)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.EditText.setText(EditText.java:78)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2567)
03-30 17:28:27.695: E/AndroidRuntime(341): at project.Excel.AndroidProjectActivity$1.afterTextChanged(AndroidProjectActivity.java:107)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.sendAfterTextChanged(TextView.java:6309)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2731)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2592)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.EditText.setText(EditText.java:78)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2567)
03-30 17:28:27.695: E/AndroidRuntime(341): at project.Excel.AndroidProjectActivity$1.afterTextChanged(AndroidProjectActivity.java:107)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.sendAfterTextChanged(TextView.java:6309)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2731)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2592)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.EditText.setText(EditText.java:78)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2567)
03-30 17:28:27.695: E/AndroidRuntime(341): at project.Excel.AndroidProjectActivity$1.afterTextChanged(AndroidProjectActivity.java:107)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.sendAfterTextChanged(TextView.java:6309)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2731)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2592)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.EditText.setText(EditText.java:78)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2567)
03-30 17:28:27.695: E/AndroidRuntime(341): at project.Excel.AndroidProjectActivity$1.afterTextChanged(AndroidProjectActivity.java:107)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.sendAfterTextChanged(TextView.java:6309)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2731)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2592)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.EditText.setText(EditText.java:78)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2567)
03-30 17:28:27.695: E/AndroidRuntime(341): at project.Excel.AndroidProjectActivity$1.afterTextChanged(AndroidProjectActivity.java:107)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.sendAfterTextChanged(TextView.java:6309)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2731)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2592)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.EditText.setText(EditText.java:78)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2567)
03-30 17:28:27.695: E/AndroidRuntime(341): at project.Excel.AndroidProjectActivity$1.afterTextChanged(AndroidProjectActivity.java:107)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.sendAfterTextChanged(TextView.java:6309)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2731)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2592)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.EditText.setText(EditText.java:78)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2567)
03-30 17:28:27.695: E/AndroidRuntime(341): at project.Excel.AndroidProjectActivity$1.afterTextChanged(AndroidProjectActivity.java:107)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.sendAfterTextChanged(TextView.java:6309)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2731)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2592)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.EditText.setText(EditText.java:78)
03-30 17:28:27.695: E/AndroidRuntime(341): at android.widget.TextView.setText(TextView.java:2567)
03-30 17:28:27.695: E/AndroidRuntime(341): at project.Excel.AndroidProjectActivity$1.afterTextChanged(AndroidProjectActiv
03-30 17:28:31.234: I/Process(341): Sending signal. PID: 341 SIG: 9
あなたのlogcatを追加してください。 –
@Samirログインを確認してください –