What\'s wrong with my code, I\'m trying to display my TextView named \"invalid\", in different locations (left,right,center), but the gravity (left,right,center) w
99% of the time, not working properly == not used properly.
You are mistaking gravity and layout_gravity.
gravity is the way the text will align itself in the TextView. The TextView being in wrap_content this does nothing, as the TextView is exactly the size of the text.
layout_gravity is the way the TextView will align itself in its parent, in your case in the vertical LinearLayout