Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

array srting line by line in textview android

// HazaaZOOZ - java - Android studio - How to set array srting line by line in textview

public class MainActivity extends AppCompatActivity {    

    String[] word = {"This is text1.So it should be single line", "This is text2", "This is text3"};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main); 


        TextView textView = findViewById(R.id.textureView1);
        for (int i = 0; i < word.length; i++) {
            textView.append(word[i]);
            textView.append("
");
        }



    }


}
 
PREVIOUS NEXT
Tagged: #array #srting #line #line #textview #android
ADD COMMENT
Topic
Name
1+5 =