Answers for "array srting line by line in textview android"

0

array srting line by line in textview android

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("\n");
        }



    }


}
Posted by: Guest on February-28-2021

Code answers related to "array srting line by line in textview android"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language