title: Error: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
body: <p>I got a problem with my android app. I got a button and and event associated , but when I click the first time an error appears</p>
  <blockquote>
  <p>&quot;spans cannot have zero lenght&quot;.</p>
  </blockquote>
  <p>. But when I click the second time, the event onclick runs well..
  look at my java code:</p>
  <pre><code>public class MainActivity extends Activity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      
      final Button selectAltitude = (Button) findViewById(R.id.buttonAltitude1);
      final Button selectAltitude2 = (Button) findViewById(R.id.buttonAltitude2); 
      
      selectAltitude2.setOnClickListener(new View.OnClickListener() {
          public void onClick(View view){
              
                  String tempAlt = selectAltitude2.getText().toString();
                  selectAltitude2.setText(selectAltitude.getText().toString());
                  selectAltitude.setText(tempAlt);
          }
      });
      }
  </code></pre>
  <p>The xml code with the two buttons (a deprecated warning occurs):</p>
  <pre><code> &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; 
  &lt;AbsoluteLayout
    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; 
    android:orientation=&quot;vertical&quot; 
    android:layout_width=&quot;fill_parent&quot; 
    android:layout_height=&quot;fill_parent&quot;
    android:background=&quot;@android:color/black&quot;&gt; 
  
  &lt;Button
          android:id=&quot;@+id/buttonAltitude1&quot;
          style=&quot;?android:attr/buttonBarButtonStyle&quot;
          android:layout_width=&quot;39dp&quot;
          android:layout_height=&quot;42dp&quot;
          android:layout_marginLeft=&quot;250dp&quot;
          android:layout_x=&quot;257dp&quot;
          android:layout_y=&quot;419dp&quot;
          android:background=&quot;@drawable/drawable1&quot;
          android:focusableInTouchMode=&quot;true&quot;
          android:gravity=&quot;center_vertical&quot;
          android:includeFontPadding=&quot;false&quot;
          android:linksClickable=&quot;true&quot;
          android:minHeight=&quot;10dp&quot;
          android:minWidth=&quot;64dp&quot;
          android:paddingLeft=&quot;10dp&quot;
          android:paddingRight=&quot;5dp&quot;
          android:scrollHorizontally=&quot;true&quot;
          android:text=&quot;@string/button_meters&quot;
          android:textColor=&quot;@android:color/black&quot;
          android:textSize=&quot;22sp&quot;
          android:textStyle=&quot;bold&quot; /&gt;
          
          &lt;Button
              android:id=&quot;@+id/buttonAltitude2&quot;
              style=&quot;?android:attr/buttonBarButtonStyle&quot;
              android:layout_width=&quot;65dp&quot;
              android:layout_height=&quot;42dp&quot;
              android:layout_marginLeft=&quot;250dp&quot;
              android:layout_x=&quot;295dp&quot;
              android:layout_y=&quot;419dp&quot;
              android:background=&quot;@drawable/drawable2&quot;
              android:clickable=&quot;true&quot;
              android:focusableInTouchMode=&quot;true&quot;
              android:gravity=&quot;center_vertical&quot;
              android:includeFontPadding=&quot;false&quot;
              android:linksClickable=&quot;true&quot;
              android:minHeight=&quot;10dp&quot;
              android:minWidth=&quot;64dp&quot;
              android:paddingLeft=&quot;15dp&quot;
              android:paddingRight=&quot;5dp&quot;
              android:scrollHorizontally=&quot;true&quot;
              android:text=&quot;@string/button_feet&quot;
              android:textColor=&quot;@android:color/black&quot;
              android:textSize=&quot;25sp&quot;
              android:textStyle=&quot;bold&quot; /&gt;
  </code></pre>
  <p>When I click the first time Log cat interacts with:</p>
  <blockquote>
  <p>04-06 20:01:39.865: I/Sensors(6946): sendDelay --- 200000000 04-06</p>
  <p>20:01:39.865: D/SensorManager(6946): JNI - sendDelay 04-06</p>
  <p>20:01:39.865: I/SensorManager(6946): Set normal delay = true 04-06</p>
  <p>20:01:39.890: E/SpannableStringBuilder(6946): SPAN_EXCLUSIVE_EXCLUSIVE</p>
  <p>spans cannot have a zero length 04-06 20:01:39.890:</p>
  <p>E/SpannableStringBuilder(6946): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot</p>
  <p>have a zero length</p>
  </blockquote>
  <p>can you help ne?;)</p>