Q:

Flow Layout in JAVA File

This is my Project XML Layout 
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

    android:id="@+id/flowLayout"

    android:layout_width="wrap_content"

    android:layout_height="wrap_content"

    android:orientation="vertical" >

    <!-- enter code here -->
</LinearLayout>

I need to access it in the JAVA file which should contain 3 sentences in 3 text views ...
public class MainActivity extends Activity {

private View layout;
@Override

    protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_main);
    findViewById();

        //enter code here
    }
    private void findViewById() {

    View layout = findViewById(R.id.flowLayout);

        //enter code here
    }
}

A:

To add a TextView to your layout do this:
LinearLayout layout = (LinearLayout)findViewById(R.id.flowLayout); //depending on which layout is it.

Then, Create a TextView, set it text and add it to the layout:
TextView tvText = new TextView(this);
tvText.setText("your desired sentence");
layout.addView(tvText);

and do this for all 3 of your TextViews, for setting the height and width use LayoutParams (example):
LinearLayout.LayoutParams layoutParams=new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
layoutParams.setMargins(0, 0, 2, 0);

As you can see this is the way you set Mergins as well, in the end set those params to the textView:
tvText.setLayoutParams(layoutParams);

