I am facing a problem when gets height/width of TextView.
My code :
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(saved
tv1.getHeight() will return 0 (as well as tv2.getWidth()) if it's not drawed yet.
Solution would be to get the height after your view is layouted:
tv1.post(new Runnable(){
public void run(){
int height = tv1.getHeight();
}
});
tv2.post(new Runnable(){
public void run(){
int height = tv2.getHeight();
}
});