I am adding a View in a LinearLayout, this way:
LinearLayout ll=(LinearLayout)findViewById(R.id.linearlayout);
TextInputLayout til=new TextInputLayout(MainActivity.this);
til.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT));
Log.i("TAG","BEFORE: "+ll.getChildCount());
ll.addView(til);
Log.i("TAG","AFTER: "+ll.getChildCount());
This way, the til object is not shown, but it IS added, because in the second log I see the number has incremented by one, the view I just added.
Why can't I see it? how to show the new view in the layout?
Thank you.