Adding Custom View to XML Layout with OnTouchListener?

I think you might be missing invallidate() call of the view on its touch reading delegates.

I think you might be missing invallidate() call of the view on its touch reading delegates. I am not sure exactly what is happening in your code. But if I would be creating my own view and adding it in my own layout as you did.

And want it to change itself on reading touch events then I would be doing something like in the myown view class it self @override // I don't remem exact signature of this method. Google it or see docs // motive is to read touch event of view and doing appropriate changes // and redrawing the view again public void onTouchEvent(MotionEvent me) { doCalculation(); // change points where to draw the ball next time. Read me invalidate(); // tell the view re draw it self } Hope it helps :).

I'm sorry, I don't really understand what you're trying to say. And I tried adding invallidate(); to the end of my OnTouchEvent but it comes up with an error "The method invallidate() is undefined for the type NewSesh" – Jarnuman Nov 6 '11 at 5:57 Spelling mistake type invalidate() . And also verify your view class is a subclass of default View or any of its subclass – Javanator Nov 6 '11 at 6:36 It's still giving me an error when I try invalidate(); saying that it isn't defined in my java class.

And what do you mean 'verify your view class is a subclass of default View or any of its subclass'? – Jarnuman Nov 6 '11 at 22:26.

I ran into the same issue, and found your question while looking for the answer. I solved it, but I'm not sure it is the proper way.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions