array srting line by line in textview android

Solutions on MaxInterview for array srting line by line in textview android by the best coders in the world

showing results for - "array srting line by line in textview android"
Lotta
20 Jan 2020
1public class MainActivity extends AppCompatActivity {    
2
3    String[] word = {"This is text1.So it should be single line", "This is text2", "This is text3"};
4
5    @Override
6    protected void onCreate(Bundle savedInstanceState) {
7        super.onCreate(savedInstanceState);
8        setContentView(R.layout.activity_main); 
9
10
11        TextView textView = findViewById(R.id.textureView1);
12        for (int i = 0; i < word.length; i++) {
13            textView.append(word[i]);
14            textView.append("\n");
15        }
16
17
18
19    }
20
21
22}
23
similar questions