I create a class and extend it from view. also implemented the Runnable interface. In the onTouchEvent i call: new Thread(this).start()
.
This is my class:
public class test extend View interface Runnable{
----some code------
public void onTouchEvent(MotionEvent event){
----somecode------
new thread(this).start();
----somecode------
}
public void run(){
-----somecode-------
invalidate();
-----somecode-------
}
}
but i receive this error:
only the original thread that created a view hierarchy can touch its views
How can i fix this?