What is the error in this code..?

You are not applying dp the right way.
Please see the comment and change it.