我在我的Android應用程序一名認爲,似乎呈現出某種內存引用,而不是說我已經將它設置爲顯示字符串資源。它看起來與當您嘗試使用java中的默認toString打印數組時發生的情況相同。任何幫助,試圖發現什麼是錯的將是一個很大的幫助。我會後下面的代碼片段:的Android TextView的顯示內存引用
XML佈局
<TextView
android:id="@+id/summary_name_heading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="40dp"
android:layout_marginTop="20dp"
android:background="@color/secondary"
android:textColor="@color/text"
android:textSize="22sp" />
字符串資源
<string name="summary_name_heading_text">Song : </string>
代碼
TextView nameHeading = (TextView)findViewById(R.id.summary_name_heading);
nameHeading.setText(R.string.summary_name_heading_text);
這是它在屏幕上顯示:
android.wi [email protected]
粘貼在那裏你想顯示你的'TextView'文本中的代碼片段。 – SudoRahul 2013-03-08 14:30:50
這些是代碼片段我只是填充從資源文件夾中我沒有Android的代碼處理的標題字符串這個文本視圖。 – peppermcknight 2013-03-08 14:33:00
檢查我的答案。嘗試這樣做,它應該**顯示**你想要的。 – SudoRahul 2013-03-08 14:35:53