Skip to content Skip to sidebar Skip to footer

Java Android Settext Doesnt Work

My Client class should give the values of x_atual,y_atual etc... I tried to debug the code by commenting the last two lines of code and the settext doesnt even work. The TextViews

Solution 1:

It is because when you call setText, the view creations have not been finished yet.

x_atual.post(newRunnable() {
        @Overridepublicvoidrun() {
            x_atual.setText("hi!");
        }
    });

Do this for each one.

This waits until the view is finished, then it will setText.

Post a Comment for "Java Android Settext Doesnt Work"