Android Google Analytics SDK show "SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length"

13,066

Solution 1

(Note: This is my first reply on StackOverflow. I just joined.)

I've seen a lot of posts regarding how SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length. Just now found my solution for my button that won't behave because of this error. It's a textview button problem, when they are non-editable (immutable). It made sense to me via developer.android.com what a span was, and that it's either mutable or not. It's a place to put fixed or editable text. I think API17 &/or Android4.2 doesn't handle zero length spans well. After driving me insane for 4 days, I bumped into the res/layout XML I have.

Navigating the lazy way I did, and going to the graphical XML properties pane on the right hand side of the workspace, there's a TextView tab listed after you click and highlight your button in question. After promoting/expanding the TextView tab, there's an Input Type entry at the bottom of that list. On the right hand side of that entry, there are ellipses. Click on those. After promoting those ellipses, it yields another list of stuff. Click 'None'. Lastly, save the XML file.

That was my solution. I hope it will work for you.

Solution 2

android:textIsSelectable="false" NOT TRUE

   <TextView 
 android:id="@+id/rowTextView"   
 android:layout_width="fill_parent"  
 android:layout_height="wrap_content"
 android:padding="20dp"  
 android:textSize="25sp"    
 android:textIsSelectable="false" />
Share:
13,066
Antaresm
Author by

Antaresm

Mobile developer (iOS, Android)

Updated on June 05, 2022

Comments

  • Antaresm
    Antaresm almost 2 years

    I added SDK in my project and call this methods:

    @Override
    public void onStart() {
        super.onStart();
        EasyTracker.getInstance().activityStart(this); 
    }
    
    @Override
    public void onStop() {
        super.onStop();
        EasyTracker.getInstance().activityStop(this);
    } 
    

    In LogCat I see ERROR: "SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length" and analytics do not work.