I am trying to retrieve the width of my TextView which is loaded with text. Here is the code I use,
txt_MyText.measure(0, 0);
float textViewWidth = txt_MyText.getMeasuredWidth();
Now this code returns the value as 25882.0
I am testing this on Samsung Galaxy S6 Edge which has a Screen Dimension of Samsung Galaxy S6, S6 Edge 5.1″ 1440×2560
I am not sure in what unit this value is returned. In my XML I am setting the TextView width as WRAP_CONTENT.
How to get the width of the text view in PIXELS.
Thanks.