Search code examples
android-studioandroid-fragmentstextviewandroid-xmlandroid

Maximum number of words we can write in android studio string (xml text)


What is the maximum number of words we can write in android studio xml "text". I was making a glossary of words that I can use for my own purpose. I cut and paste a 5000 lines of glossary in

TextView android:text="glossary".

When I build and installed apk there were no texts. It was blank, however, if I use only one line, then it shows that line. Please guide me. How I can write a long list in fragment_glossary.xml


Solution

    1. There is no Lenght limit by default.
    2. Use string.xml for inflating any Strings in TextView.
    3. If your data is dynamic use JAVA Object:-

      String mString = "your very long text string";

      Textview mTextview = (Textview) findViewById(R.id.textViewId);

      mTextview.setText(mString);