What is the difference between android:layout_alignRight="ID" and android:layout_toRightOf="ID"?
This picture will explain the difference :
layout_alignRight
aligns the right edges of the two views.
layout_toRightOf
aligns the left edge of this view with the right edge of the other someId
view.
Documentation: http://developer.android.com/reference/android/widget/RelativeLayout.LayoutParams.html