Note that there are some explanatory texts on larger screens.

plurals
  1. POMy Android is messing up my text Views
    primarykey
    data
    text
    <p>i'm using relative layout and I'm trying to figure out why my textViews are messing up. Here is how it starts <sup>(click to enlarge)</sup></p> <p><a href="https://i.stack.imgur.com/wX091.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wX091m.png" alt="enter image description here"></a></p> <p>But then when the values star coming in it looks like this</p> <p><a href="https://i.stack.imgur.com/8CEka.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8CEkam.png" alt="enter image description here"></a></p> <p>This is my xml.</p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity" &gt; &lt;TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:text="@string/inputVariables" android:textAppearance="?android:attr/textAppearanceMedium" /&gt; &lt;TextView android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/textView1" android:layout_below="@+id/textView1" android:layout_marginTop="84dp" android:text="@string/startingPoint" android:textAppearance="?android:attr/textAppearanceMedium" /&gt; &lt;TextView android:id="@+id/TextView02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/TextView01" android:layout_centerVertical="true" android:text="@string/calculatedPoint" android:textAppearance="?android:attr/textAppearanceMedium" /&gt; &lt;TextView android:id="@+id/speed" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/textView3" android:layout_alignBottom="@+id/textView3" android:layout_alignLeft="@+id/heading" android:text="TextView" /&gt; &lt;TextView android:id="@+id/textView9" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignRight="@+id/textView1" android:layout_below="@+id/TextView02" android:layout_marginTop="14dp" android:text="@string/oneSecond" /&gt; &lt;TextView android:id="@+id/textView10" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/textView9" android:layout_below="@+id/textView8" android:layout_marginTop="25dp" android:text="@string/tenMilliSecond" /&gt; &lt;TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/textView9" android:layout_below="@+id/textView1" android:layout_marginLeft="17dp" android:layout_marginTop="16dp" android:text="@string/heading" /&gt; &lt;TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignRight="@+id/textView7" android:layout_below="@+id/textView2" android:text="@string/speed" /&gt; &lt;TextView android:id="@+id/oneSecondCalculatedPointLongitude" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_above="@+id/textView10" android:layout_alignLeft="@+id/oneSecondCalculatedLatitude" android:text="TextView" /&gt; &lt;TextView android:id="@+id/textView7" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/textView2" android:layout_below="@+id/textView9" android:layout_marginTop="16dp" android:text="@string/latitude" /&gt; &lt;TextView android:id="@+id/oneHundredMillisecondLatitude" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignLeft="@+id/oneSecondCalculatedPointLongitude" android:layout_below="@+id/textView10" android:layout_marginTop="18dp" android:text="TextView" /&gt; &lt;TextView android:id="@+id/textView11" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/oneHundredMillisecondLatitude" android:layout_alignBottom="@+id/oneHundredMillisecondLatitude" android:layout_toLeftOf="@+id/heading" android:text="@string/latitude" /&gt; &lt;TextView android:id="@+id/oneHundredMillisecondLongitude" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignLeft="@+id/oneHundredMillisecondLatitude" android:layout_below="@+id/oneHundredMillisecondLatitude" android:text="TextView" /&gt; &lt;TextView android:id="@+id/textView12" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/oneHundredMillisecondLongitude" android:layout_alignBottom="@+id/oneHundredMillisecondLongitude" android:layout_toLeftOf="@+id/heading" android:text="@string/longitude" /&gt; &lt;TextView android:id="@+id/textView8" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/textView7" android:layout_toLeftOf="@+id/heading" android:text="@string/longitude" /&gt; &lt;TextView android:id="@+id/textView6" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/textView5" android:layout_toLeftOf="@+id/heading" android:text="@string/longitude" /&gt; &lt;TextView android:id="@+id/startingPointLatitude" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/speed" android:layout_below="@+id/TextView01" android:layout_marginTop="26dp" android:text="TextView" /&gt; &lt;TextView android:id="@+id/textView5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/startingPointLatitude" android:layout_alignBottom="@+id/startingPointLatitude" android:layout_toLeftOf="@+id/heading" android:text="@string/latitude" /&gt; &lt;TextView android:id="@+id/startingPointLongitude" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/textView6" android:layout_alignBottom="@+id/textView6" android:layout_alignLeft="@+id/startingPointLatitude" android:text="TextView" /&gt; &lt;TextView android:id="@+id/oneSecondCalculatedLatitude" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_above="@+id/textView8" android:layout_alignLeft="@+id/startingPointLongitude" android:text="TextView" /&gt; &lt;TextView android:id="@+id/heading" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/textView2" android:layout_alignBottom="@+id/textView2" android:layout_marginLeft="16dp" android:layout_toRightOf="@+id/textView2" android:text="TextView" /&gt; </code></pre> <p></p> <p>This is my Code thats changing the textView.texts</p> <pre><code> Location predicationPoint = DOTGpsAppUtils.predictionAlgorithm(latitude, longitude, 1, 100); double predictionLongitude = (longitude + predicationPoint.getLongitude())/2; double predictionLatitude = (latitude + predicationPoint.getLatitude())/2; TextView textView = (TextView) findViewById(R.id.oneHundredMillisecondLatitude); textView.setText(Double.valueOf(predictionLatitude).toString()); textView = (TextView) findViewById(R.id.oneSecondCalculatedPointLongitude); textView.setText(Double.valueOf(predictionLongitude).toString()); if(x == 9) { longitude = predictionLongitude; latitude = predictionLatitude; } System.out.println(x); ++x; }while(x &lt; 10); TextView textView = (TextView) findViewById(R.id.startingPointLongitude); textView.setText(Double.valueOf(location.getLongitude()).toString()); textView = (TextView) findViewById(R.id.startingPointLatitude); textView.setText(Double.valueOf(location.getLatitude()).toString()); textView = (TextView) findViewById(R.id.oneSecondCalculatedPointLongitude); textView.setText(Double.valueOf(longitude).toString()); textView = (TextView) findViewById(R.id.oneSecondCalculatedLatitude); textView.setText(Double.valueOf(latitude).toString()); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload