Yes, whenever you stack objects that are not crossing you have to put layer=* on them so that it is clear in what order they appear from bottom to top. If no layer tag is attached that defaults to layer=0. It’s customary to put layer=0 on an object on ground level but you can chose arbitrary values as long as the order is clear.
How does this question relate to Android? You would have better placed it in the Questions and Answers section.