I made ScrollView and inside its LinearLayout I put a TextView,
I just want to put string in it until the TextView exceeds the layout.
The problem whit my code is that while loop never ends.
public class MainActivity extends Activity {
public static int screenWidth,screenHeight;
public boolean overlap;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main) ;
    ScrollView scroll=(ScrollView) findViewById(R.id.scrollView1);
    TextView mytextview=(TextView) findViewById(R.id.textview1);
    TextView textshow=(TextView) findViewById(R.id.textView2);
    LinearLayout linearLayout = (LinearLayout) findViewById(R.id.linearlayout);
    mytextview.setText("");
    ViewTreeObserver vto=scroll.getViewTreeObserver();
    getmeasure(vto,mytextview,scroll,linearLayout);
}
public void getmeasure(ViewTreeObserver vto, final TextView mytextview2, final ScrollView scroll2, final LinearLayout linearLayout2) {
    vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
        @Override
        public void onGlobalLayout() {
            int a=linearLayout2.getMeasuredHeight();
            int b=scroll2.getHeight();
            while (a<b) {
                mytextview2.append("full    full    full");
                a=linearLayout2.getMeasuredHeight();
                b=scroll2.getHeight();
                }
            }
    });
}