2012-04-24 80 views
-4

請幫助我,誰曾看到以下錯誤:如何解決堆棧溢出的Android

**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 
+0

通過這第一個http://stackoverflow.com/faq! – 2012-04-24 16:40:26

回答

11

那麼它肯定看起來像你onTextChanged處理程序調用setButton,而這又是哪位setText,這再次調用您的onTextChanged處理程序,導致無限遞歸。

恩,不要那樣做。

如果沒有關於您正在嘗試做什麼或您的代碼是什麼樣子的更多信息,很難給出更具體的建議。

+0

非常非常好的答案。非常感謝你 。 – 2012-04-25 01:50:49