This is the code I am using and it is not working:
For aligning one element at start and one at the end of the LinearLayout, you can wrap it in an RelativeLayout.
LinearLayout
RelativeLayout
The result of this example is following: Link to the image
Note: You can wrap whatever you want inside and align it.