i want to know how many line in my text view. i already set mytextview text, then i want to get how many line it take in mytextview.
i use mytextview.getLineCount() but it didn't work. it always return 0.
can someone helpme.
i want to know how many line in my text view. i already set mytextview text, then i want to get how many line it take in mytextview.
i use mytextview.getLineCount() but it didn't work. it always return 0.
can someone helpme.
You need to post method for fetching the lines counts. Here is the sample code
you can check the TextView parameters inside onCreateOptionsMenu()
thanks for all. i solved it already. i use thread to get the linecount just like this
hope this will help if you have same problem. best regard.
The Following will provide the lines count of the textview at the same place you set tv.setText().
public int getLineCount ()
Since: API Level 1
Return the number of lines of text, or returns 0 if the internal Layout has not been built.
Please check this link.
Android Edittext: Get LineCount in an Activity's onCreate()
tv.getLineCount(), will always retirn 0, if internal layout is not created yet.