I have a ViewGroup and it has a few children. And one of them is a TextView (\"+id/text\"). In my code, I would like to know how can I add a new View or ViewGroup which will
Consider using a TableLayout as your ViewGroup. With a TableLayout you can programmatically add a child at a specific location.
View view = new ViewIWantToAdd();
TableLayout layout = (TableLayout)findViewById(R.id.table_layout);
layout.addView(view);
Would add a view at the bottom of the TableLayout. Typically you would use a TableRow as the contents of the TableView, but you can add any view.