setText("hello") doesn't work
I have it in my onCreate
TextView tx = (TextView) findViewById(R.id.stuff);
tx.setText("hello");
It stays blank.
setText("hello") doesn't work
I have it in my onCreate
TextView tx = (TextView) findViewById(R.id.stuff);
tx.setText("hello");
It stays blank.
an old answer: Java Android SetText Doesnt Work
try:
tx.post(new Runnable() {
    @Override
    public void run() {
        tx.setText("hello");
    }
});
Sometimes the TextView hasn't finished being created, so your setText() won't apply yet. This makes sure it's done after it's finished creation.