I think you use require
incorrectly. I get the feeling you want it to tell you when the START_TAG
is equal to <CarStatus>
. But at each failed check the require method will throw an exception, meaning you have to add a try-catch block and the loop will be kind of weird. Please refer to android doc for further info.
I would personally not do it using reqiure but rather like I wrote in the comment above (this thread). I must however admit I have not done this in quite some time. :-)