I have the following inside a relative layout.
The layout which you are trying to use as a reference should be defined before it is used as reference i.e. use as 'layout_toLeftOf'.
It is like you have to declare a variable in java before using it. Declare then use it ...
If you need to mention the id before its defined in the file, then you need to use @+id/textView1
instead of @id/textView1