正如在其他一些線程中提到的,我無法從BaseAdapter的Textview中設置文本。android baseAdapter奇怪的錯誤
每當我試圖設置希伯來語字符串裏面,我得到一個stackoverflow錯誤..當設置英文字符串 - 完美的作品 我試圖找出哪裏exegicly錯誤是,所以我已經分手每件我的代碼,這是我學到了什麼: 當我的文本視圖嵌套一個新視圖內 - 出現的計算器..
在這個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" />
<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
任何想法,爲什麼???
在你的「破碎的」XML中,用希伯來語,如果你的'textView1'對象在'TableRow'內,會發生什麼?另外,你在「TextView」中設置文本的代碼是什麼? – Eric
正如我所說,當它是在一個錶行(或任何其他佈局),我得到一個stackoverflow ...我設置它簡單地通過使用setText(「希伯來字符串」) –