Android using ellipsize on widget text
<p>I created a widget with text. I want to add ... to the end of the text where there is not enough place to show the whole text. I used   <code>android:ellipsize="end"</code> but only the first two rows are visible.</p>

<p>This is the widget layout:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="64dip"
    android:layout_height="72dip"
    android:layout_gravity="center"
    android:id="@+id/widgetlayout"&gt;

    &lt;ImageView android:id="@+id/ImageView01"
     android:layout_width="72dip" 
     android:layout_height="72dip"
     android:scaleType="fitXY"&gt;
    &lt;/ImageView&gt;

    &lt;TextView
        android:id="@+id/tvConfigInput"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:gravity="left"
        android:textColor="#FFFFFF"
        android:layout_margin="2dip"    
        android:ellipsize="end"
        android:textSize="12dip" /&gt;

&lt;/RelativeLayout&gt;
</code></pre>

<p>The first image is with the ellipsize effect. The second one is without it. You can see there is enough place to show more text.</p>

<p><img src="http://i.stack.imgur.com/UDy5U.png" alt="enter image description here">
I tried out in a 1x2 widget also, same happens</p>

<p><img src="http://i.stack.imgur.com/yFhvK.png" alt="enter image description here"></p>

<p>Thanks to Devunwired, I am now trying with this, but nothing has changed (I guess I am doing sg wrong)</p>

<pre><code>RemoteViews views = new RemoteViews(c.getPackageName(), R.layout.widget_layout);

        TextPaint paint = new TextPaint(); 
        final float densityMultiplier = this.getResources().getDisplayMetrics().density;
        final float scaledPx = 20 * densityMultiplier;
        paint.setTextSize(scaledPx);
        final float size = paint.measureText(widgettext);  
        Log.i("size", size + "");  //1716 e.g

        while (widgettext != TextUtils.ellipsize(widgettext, paint, (float)GetDipsFromPixel(72),  TextUtils.TruncateAt.END)) { 
            paint.setTextSize(paint.getTextSize() - 1);
        }

        views.setTextViewText(R.id.tvConfigInput, widgettext);
        views.setTextColor(R.id.tvConfigInput, loadedtextcolor);

        views.setFloat(R.id.tvConfigInput, "setTextSize", int_widgetfontsize);
</code></pre>
