Append text to a TextView datatype

后端 未结 5 1151
陌清茗
陌清茗 2021-02-05 08:39

I\'m a beginner android/java programmer and my background is primarily in C++ and C#. In C# if I have a string variable called myWord and it has a value of \"Hello\" I can appen

5条回答
  •  鱼传尺愫
    2021-02-05 09:19

    If you are using TextView, use append. For example:

    TextView textView = (TextView) findViewById(R.id.myText);
    textView.setText("Hello");
    textView.append(" Bob!");
    

提交回复
热议问题