正如在其他一些线程中提到的,我在从我的 BaseAdapter 的 Textview 中设置文本时遇到了麻烦。
每当我尝试在其中设置希伯来语字符串时,我都会收到 stackoverflow 错误.. 设置英文字符串时 - 完美运行我试图找出错误的确切位置,所以我已经分解了我的每一段代码这就是我发现的:当我的文本视图嵌套在新视图中时 - 出现 stackoverflow..
在这个 XML 中有 stackoverflow(仅在希伯来语字符串中):
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TableRow>
<include
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_gravity="center_vertical"
android:layout_margin="4dp"
layout="@layout/list_profile_picture_green"
android:padding="4dp" />
<TableLayout android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
</TableLayout>
</TableRow>
</TableLayout>
这个 XML 完美地显示了希伯来语:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TableRow>
<include
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_gravity="center_vertical"
android:layout_margin="4dp"
layout="@layout/list_profile_picture_green"
android:padding="4dp" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
</TableRow>
</TableLayout>
这是我的堆栈跟踪:
06-24 00:48:02.565: E/AndroidRuntime(20483): FATAL EXCEPTION: main
06-24 00:48:02.565: E/AndroidRuntime(20483): java.lang.StackOverflowError
06-24 00:48:02.565: E/AndroidRuntime(20483): at java.lang.StringBuilder.append(StringBuilder.java:312)
06-24 00:48:02.565: E/AndroidRuntime(20483): at java.lang.StringBuilder.append(StringBuilder.java:44)
06-24 00:48:02.565: E/AndroidRuntime(20483): at java.util.Formatter.outputCharSequence(Formatter.java:1114)
06-24 00:48:02.565: E/AndroidRuntime(20483): at java.util.Formatter.doFormat(Formatter.java:1086)
06-24 00:48:02.565: E/AndroidRuntime(20483): at java.util.Formatter.format(Formatter.java:1062)
06-24 00:48:02.565: E/AndroidRuntime(20483): at java.util.Formatter.format(Formatter.java:1031)
06-24 00:48:02.565: E/AndroidRuntime(20483): at java.lang.String.format(String.java:2183)
06-24 00:48:02.565: E/AndroidRuntime(20483): at java.lang.String.format(String.java:2157)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.text.Styled.drawDirectionalRun(Styled.java:266)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.text.Styled.drawText(Styled.java:362)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.text.Layout.drawText(Layout.java:1546)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.text.Layout.draw(Layout.java:380)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.widget.TextView.onDraw(TextView.java:4417)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.View.draw(View.java:6933)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.widget.AbsListView.dispatchDraw(AbsListView.java:1648)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.widget.ListView.dispatchDraw(ListView.java:3217)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.View.draw(View.java:6936)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.widget.AbsListView.draw(AbsListView.java:3030)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.View.draw(View.java:6936)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.widget.FrameLayout.draw(FrameLayout.java:357)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.View.draw(View.java:6936)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.widget.FrameLayout.draw(FrameLayout.java:357)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.View.draw(View.java:6936)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.widget.FrameLayout.draw(FrameLayout.java:357)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.View.draw(View.java:6936)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.widget.FrameLayout.draw(FrameLayout.java:357)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.view.View.draw(View.java:6936)
06-24 00:48:02.565: E/AndroidRuntime(20483): at android.widget.FrameLayout.draw(FrameLayout.java:357)
06-24 00:48:02.565: E/AndroidRuntime(20483): at com.android.internal.policy.impl.P
知道为什么吗???