Android - Only the original thread that created a view hierarchy can touch its views



  • When pressed on the button, it starts the method of change by animating SCALE and ALPHA IamgeView, it works normally, and there's a mistake

    Android“Only the original thread that created a view hierarchy can touch its views.

    // код находится внутри слушателя для кнопки
    new  Thread (new Runnable() {
                            public void run() {
                                imageViewRipple2.startAnimation(animation2);
                            }
                        }).start();
    


  • Any action with UI must be carried out in UI by flow, otherwise by mistake. But if you have to make calculations in another flow and then post the results in UI, use it. http://startandroid.ru/ru/uroki/vse-uroki-spiskom/143-urok-80-handler-nemnogo-teorii-nagljadnyj-primer-ispolzovanija.html ♪




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2