My aim is that the overridden class object invalidates itself from outside and then because of invalidation paint method gets called.

Inside the paint method i have a string already present as a variable(which might have been obtained in any way).Now i want to draw this string.

If i use suprer.settext(string) inside the paint method then it creates an infinite loop.I believe that this is because settext() results in calling of invalidate which again calls paint which leads to again calling settext and hence the lopp.

Therefore i want to know how to draw the given string without there being an infinite loop.