Home android Android - Only The Original Thread That Created A View Hierarchy Can...

Android – Only The Original Thread That Created A View Hierarchy Can Touch Its Views

Author

Date

Category

When you press the button, it starts the change method using the Animation Scale and Alpha IAMGEView, it happens normally, and it happens the error

Android “Only The Original Thread That Created A View Hierarchy Can Touch Its Views.

// code is inside a listener for a button
NEW Thread (new Runnable () {
            Public void Run () {
              imageviewRipple2.startanimation (Animation2);
            }
          }). start ();

Answer 1, Authority 100%

Any actions with UI must be performed in the UI stream, otherwise – an error. But if you need to perform calculations in another stream, and then post the result in UI, then use Handler .

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions