after asking a question about Place Button just after end of TextView in multilline TextView
I give no answer but I think if find the position of end character of final line of textview , then my problem is solved .
so how could find out the end of text position in last line of textview?
tank's for your help and your attention.
Asked
Active
Viewed 1,497 times
4
-
Try this solution: http://stackoverflow.com/questions/3630086/how-to-get-string-width-on-android – bclymer Jun 25 '13 at 20:39
-
I want the last line rect . how could do that? – MahdiSa Jun 25 '13 at 20:43
1 Answers
0
CharSequence cs = textView.getText();
int position = cs.charAt(cs.length()-1);

Steven Mann
- 558
- 3
- 14
-
-
The index of the last character. I would use it to hack in a link. – Steven Mann Jun 25 '13 at 20:42
-
-
Obtusely with [this](http://www.javadocexamples.com/java/awt/Component/getLocationOnScreen%28%29.html). If you are going to just throw a button in, do it in the xml with a relative layout. – Steven Mann Jun 25 '13 at 20:48
-
It does not work because the textview width is constant for all lines and that's equal to line one width's . I need find the position of end character of my textview , with that component how could do this ? thanks for your attention – MahdiSa Jun 25 '13 at 20:57