Why can't I set text to an Android TextView?

前端 未结 8 2098
孤城傲影
孤城傲影 2020-12-31 03:04

I\'m having a problem with setting text to a TextView:

TextView android:editable = \"true\".

In my .java it seems like that this should wor

8条回答
  •  孤独总比滥情好
    2020-12-31 03:34

    The code should instead be something like this:

    TextView text = (TextView) findViewById(R.id.this_is_the_id_of_textview);
    text.setText("test");
    

提交回复
热议问题