I try to calculate the size of the screen when I open the Layout and create the corresponding number of color bars with a height of 100dp on it, using the same method to generate stripes as when scrolling, but when scrolling, the stripes are generated and everything is fine, and when opened in a debugger, writes that LinearLayout The right amount of Children, but they are not on the screen
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); svContent = (ExtraScrollView) findViewById(R.id.svScroll); svContent.setOnScrollChanged(new ExtraScrollView.ScrollViewListener() { @Override public void onScrollChanged(ExtraScrollView scrollView, int x, int y, int oldx, int oldy) { // когда прокрутили почти до конца вниз if (y + scrollView.getExtentVertical() >= scrollView .getChildHeight() - 10) { // подгружаем данные textViewGeneration(); } } }); //этот метод и не хочет работать InitialColorStrips(); } public void InitialColorStrips() { //получим высоту экрана Point size = new Point(); WindowManager w = getWindowManager(); w.getDefaultDisplay().getSize(size); int mWindowHeight = size.y; for (int i=0; i < mWindowHeight/100 + 2; i++) { textViewGeneration(); } } public void textViewGeneration() { LinearLayout l = (LinearLayout)findViewById(R.id.container); ViewGroup.LayoutParams lpView = new ViewGroup.LayoutParams(l.getWidth(), 100); TextView tv = new TextView(this); tv.setLayoutParams(lpView); hue+=1; int parsedColor = Color.HSVToColor(new float[]{ hue, 100f, 100f } ); tv.setBackgroundColor(parsedColor); tv.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this, AdditionalActivity.class); // указываем первым параметром ключ, а второе значение // по ключу мы будем получать значение с Intent intent.putExtra("color", Color.HSVToColor(new float[]{ hue, 100f, 100f } )); startActivity(intent); } }); l.addView(tv); } The markup is as follows:
<ru.surf.victoria_sokolova.ExtraScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/svScroll"> <LinearLayout android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> </LinearLayout> </ru.surf.victoria_sokolova.ExtraScrollView> the application does not crash, but displays such

when scrolling by the same method, everything starts working

But I would like to get this:
