I want to get the height or at least the line count of my text view programatically, but the log says 0. What is wrong ? Here is my code :
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_off);
titreOff = (TextView) findViewById(R.id.offTitre);
titreOff.setText("some text"); // displays 2 lines of text with the font size I used
System.out.println(titreOff.getLineCount() + " and " + titreOff.getHeight());
}
Thanks for your advices