I have a XML file with RelativeLayout, I also have Textview which has Gravity Center. In code I would like to get X coordinate of this Textview, where the TextView begins (length of TextView is not constant, it can change). I need a ImageView to be next to the TextView.
<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentTop="true"
android:gravity="center"
android:text="TextView" /> `
countryText = (TextView) findViewById(R.id.textView6);
countryText.getLeft()
getLeft() return 0;