Q:

TextView setText doesn't refresh the text

In a Fragment I have this Thread that have to refresh the text of a 
TextView. The problem is that after setText() (the text is set in fact if I log TextView.getText() it returns the text changed) the screen the text is always the same. It change only if a add a view to the Fragment's view.
This is the code,
Thread time = new Thread() {
    public void run() {

        getActivity().runOnUiThread(new Runnable() {

            @Override
            public void run() {
                while(true) {
                  TextView.setText("some text");
                  // i tried also to use TextView.invalidate()
                }
            });

        }
    };
}

A:

Remove while(true), you are blocking the UI thread with that

