LinearLayout linearLayout = new LinearLayout(context); linearLayout.setOrientation(LinearLayout.VERTICAL); TextView textView1 = new TextView(context); textView1.setText("This is the first line of text"); linearLayout.addView(textView1); TextView textView2 = new TextView(context); textView2.setText("This is the second line of text"); linearLayout.addView(textView2);This code creates a new LinearLayout with vertical orientation and adds two TextViews to it. The ViewGroup class is included within the android.view package library.