0

When I start an activity in Handler#postDelayed(Runnable, long) I get an error log message (yes, repeated twice):

03-19 18:39:26.628: E/SpannableStringBuilder(11502): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
03-19 18:39:26.628: E/SpannableStringBuilder(11502): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

Application does not crash, however it is annoying to see this error all the time. I get no other output in the LogCat in this example.

My first activity:

public class ActivityOne extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        startActivityTwoDelayed();
    }

    private void startActivityTwoDelayed() {
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                Intent captureIntent = new Intent(ActivityOne.this,
                        ActivityTwo.class);
                startActivity(captureIntent);
            }
        }, 1000);
    }
}

My second activity:

public class ActivityTwo extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }
}

My manifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.test03"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="15" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".ActivityOne"
            android:label="@string/title_activity_main" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".ActivityTwo"
            android:label="@string/title_activity_main" >
        </activity>
    </application>

</manifest>
Maksim Sorokin
  • 2,334
  • 3
  • 34
  • 61
  • Don't use `System.out.println` in Android. If you want log messages then use `Log.d("AppName", "Log Message");`. This likely isn't causing your problem but it's just good practice/the proper way of sending log messages for the platform. – Michael Celey Mar 19 '13 at 17:16
  • @MCeley, thanks for the comment. I am aware of that. `System.out.println` does not cause the problem in this case. – Maksim Sorokin Mar 19 '13 at 17:29
  • I was sure it wasn't your problem. Just wanted to leave the tip. Some people getting into Android come from a more traditional Java background where `System.out.println` is used so I just wanted to share the info in case you weren't aware of other logging solutions. Also, could you post more of your logcat output that shows the full stack trace? – Michael Celey Mar 19 '13 at 17:32
  • @MCeley, thanks for the note. I updated the question an made it clear what output I get. – Maksim Sorokin Mar 19 '13 at 17:42

0 Answers0