Hey Sudharsana. It actually looks like you might be missing some imports:
I recommend using Android Studio when working on this stuff because it really helps to catch this sort of thing. I should update this post and get a github repo going though. Maybe later this week.