Check is textview is ellipsize in android
<p>I have <code>TextView</code> with width as <code>wrap content</code>. In this <code>TextView</code> I set text, but text is not of the same length every time. When text is very long I use single line true and <code>ellipsize</code>: end. But now I have a problem. I want to set Visibility of other layout but that depends on the length my text. If text is too long to fit in the screen I want to setVisible true, but when text is short and when I don't need ellipsize, I want to set visibility false. So I need to check status of my TextView. When its ellipsize I want to <code>setVisible</code> true, when its not <code>setVisible</code> false. How I can do that. 
This is what I got:</p>

<pre><code>tvAle.post(new Runnable() {

        @Override
        public void run() {

            int lineCount    = tvAle.getLineCount();
            Paint paint =  new Paint();
            paint.setTextSize(tvAle.getTextSize());
            final float size = paint.measureText(tvAle.getText().toString());
            Log.v("a", ""+size+" "+tvAle.getWidth());
            if ((int)size &gt; (tvAle.getWidth()+10)) {
                allergiesLayout.setVisibility(View.VISIBLE);
            }

            else
                allergiesLayout.setVisibility(View.GONE);

        }
</code></pre>

<p>but this solution doesn't work.</p>
