I wonder why my TextView in my AppWidget won't split a long text into several lines.
Can anyone pls say what I did wrong ?
content.xml
Using xml Syntax Highlighting
- <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/content"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:focusable="true"
- android:background="@drawable/mybackground">
- <TextView
- android:id="@+id/content_1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:includeFontPadding="false"
- android:ellipsize="end"
- android:textSize="10sp"
- android:textStyle="bold"
- android:layout_marginTop="10px"
- android:layout_marginLeft="10px"
- android:textColor="@android:color/black"
- />
- <TextView
- android:id="@+id/content_2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:includeFontPadding="false"
- android:layout_below="@id/content_1"
- android:ellipsize="end"
- android:textSize="10sp"
- android:textStyle="bold"
- android:layout_marginTop="10px"
- android:layout_marginLeft="10px"
- android:textColor="@android:color/black"
- />
- </RelativeLayout>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4
Using java Syntax Highlighting
- public RemoteViews buildUpdate(Context context) {
- // Build an update that holds the updated widget contents
- RemoteViews updateViews = null;
- updateViews = new RemoteViews(context.getPackageName(), R.layout.content);
- updateViews.setTextViewText(R.id.content_1, "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ");
- updateViews.setTextViewText(R.id.content_2, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
- return updateViews;
- }
Parsed in 0.012 seconds, using GeSHi 1.0.8.4