-4

请帮助我,谁曾在下面看到此错误:

**04-24 23:24:21.012: I/dalvikvm(327): threadid=1: stack overflow on call to Ljava/lang/Class;.isPrimitive:Z**
04-24 23:24:21.012: I/dalvikvm(327):   method requires 4+20+0=24 bytes, fp is 0x430c9314 (20 left)
04-24 23:24:21.012: I/dalvikvm(327):   expanding stack end (0x430c9300 to 0x430c9000)
04-24 23:24:21.073: I/dalvikvm(327): Shrank stack (to 0x430c9300, curFrame is 0x430cbeb8)
04-24 23:24:21.073: D/AndroidRuntime(327): Shutting down VM
04-24 23:24:21.073: W/dalvikvm(327): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
04-24 23:24:21.512: D/dalvikvm(327): GC_FOR_MALLOC freed 4475 objects / 369040 bytes in 192ms
04-24 23:24:21.512: E/AndroidRuntime(327): FATAL EXCEPTION: main
04-24 23:24:21.512: E/AndroidRuntime(327): java.lang.StackOverflowError
04-24 23:24:21.512: E/AndroidRuntime(327):  at java.lang.reflect.Array.newInstance(Array.java:473)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.text.SpannableStringBuilder.getSpans(SpannableStringBuilder.java:757)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.text.SpannableStringBuilder.sendSpanAdded(SpannableStringBuilder.java:902)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:611)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:514)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.text.Selection.setSelection(Selection.java:74)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.text.Selection.setSelection(Selection.java:85)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.text.method.ArrowKeyMovementMethod.initialize(ArrowKeyMovementMethod.java:497)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2676)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2556)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.EditText.setText(EditText.java:75)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2531)
04-24 23:24:21.512: E/AndroidRuntime(327):  at com.app.tabletfc.TabletFC.setButton(TabletFC.java:236)
04-24 23:24:21.512: E/AndroidRuntime(327):  at com.app.tabletfc.TabletFC$13.onTextChanged(TabletFC.java:191)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2691)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2556)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.EditText.setText(EditText.java:75)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2531)
04-24 23:24:21.512: E/AndroidRuntime(327):  at com.app.tabletfc.TabletFC.setButton(TabletFC.java:236)
04-24 23:24:21.512: E/AndroidRuntime(327):  at com.app.tabletfc.TabletFC$13.onTextChanged(TabletFC.java:191)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2691)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2556)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.EditText.setText(EditText.java:75)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2531)
04-24 23:24:21.512: E/AndroidRuntime(327):  at com.app.tabletfc.TabletFC.setButton(TabletFC.java:236)
04-24 23:24:21.512: E/AndroidRuntime(327):  at com.app.tabletfc.TabletFC$13.onTextChanged(TabletFC.java:191)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2691)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2556)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.EditText.setText(EditText.java:75)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2531)
04-24 23:24:21.512: E/AndroidRuntime(327):  at com.app.tabletfc.TabletFC.setButton(TabletFC.java:236)
04-24 23:24:21.512: E/AndroidRuntime(327):  at com.app.tabletfc.TabletFC$13.onTextChanged(TabletFC.java:191)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2691)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2556)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.EditText.setText(EditText.java:75)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2531)
04-24 23:24:21.512: E/AndroidRuntime(327):  at com.app.tabletfc.TabletFC.setButton(TabletFC.java:236)
04-24 23:24:21.512: E/AndroidRuntime(327):  at com.app.tabletfc.TabletFC$13.onTextChanged(TabletFC.java:191)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2691)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2556)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.EditText.setText(EditText.java:75)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2531)
04-24 23:24:21.512: E/AndroidRuntime(327):  at com.app.tabletfc.TabletFC.setButton(TabletFC.java:236)
04-24 23:24:21.512: E/AndroidRuntime(327):  at com.app.tabletfc.TabletFC$13.onTextChanged(TabletFC.java:191)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2691)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2556)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.EditText.setText(EditText.java:75)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2531)
04-24 23:24:21.512: E/AndroidRuntime(327):  at com.app.tabletfc.TabletFC.setButton(TabletFC.java:236)
04-24 23:24:21.512: E/AndroidRuntime(327):  at com.app.tabletfc.TabletFC$13.onTextChanged(TabletFC.java:191)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2691)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2556)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.EditText.setText(EditText.java:75)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2531)
04-24 23:24:21.512: E/AndroidRuntime(327):  at com.app.tabletfc.TabletFC.setButton(TabletFC.java:236)
04-24 23:24:21.512: E/AndroidRuntime(327):  at com.app.tabletfc.TabletFC$13.onTextChanged(TabletFC.java:191)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.sendOnTextChanged(TextView.java:6131)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:2691)
04-24 23:24:21.512: E/AndroidRuntime(327):  at android.widget.TextView.setText(TextView.java:25
4

1 回答 1

11

好吧,看起来你的onTextChanged处理程序正在调用setButton,而后者又在调用setText,它再次调用你的onTextChanged处理程序,导致无限递归。

嗯,不要那样做。

如果没有更多关于你正在尝试做什么或你的代码是什么样子的信息,很难给出更具体的建议。

于 2012-04-24T16:40:25.743 回答