Answers for "android java create textView"

2

how to create textview programmatically in android

String[] textArray = {"One", "Two", "Three", "Four"};
LinearLayout linearLayout = new LinearLayout(this);
setContentView(linearLayout);
linearLayout.setOrientation(LinearLayout.VERTICAL);        
for( int i = 0; i < textArray.length; i++ )
{
    TextView textView = new TextView(this);
    textView.setText(textArray[i]);
    linearLayout.addView(textView);
}
Posted by: Guest on November-08-2020
1

set textview text android java

//java,set textview text android studio,2021/09.23
TextView textView;

textView = findViewById(R.id.textView); //in your OnCreate() method
textView.setText("Hello World");
Posted by: Guest on September-23-2021

Code answers related to "android java create textView"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language