Why can't I set text to an Android TextView?
The code should instead be something like this:
TextView text = (TextView) findViewById(R.id.this_is_the_id_of_textview);
text.setText("test");
In your java class, set the "EditText
" Type to "TextView
". Because you have declared a TextView
in the layout.xml
file
To settext in any of in activity than use this below code... Follow these step one by one:
1.Declare
private TextView event_post;
2.Bind this
event_post = (TextView) findViewById(R.id.text_post);
3.SetText in
event_post.setText(event_post_count);