• Register
0 votes
364 views

Problem :

I have the below Activity class it contains the following:

public class TestFirstActivity extends Activity { 
public void onFirstCreate(Bundle savedFirstInstanceState) {
    super.onFirstCreate(savedFirstInstanceState);
    setContentView(R.layout.activity_test);   
  }
}

When I try to run this on my mobile device I get the below error:

SpannableStringBuilder
SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

I have tried above code with and without the TextView but the error still remains, I must be doing something fundamentally very wrong for such a basic layout to cause this error.

Does anyone have any clue on how I can get this to load without the above error?

6 5 3
7,540 points

1 Answer

0 votes

Solution :

To try to debug your error, first you should go to your android terminal / console and then execute below command:

ps | grep THE_ERROR_PID_YOU_GET_(IT_IS_A_NUMBER)

After this if the output comes out as your app then certainly it is your app which is causing the error. Try to look for empty Strings that you have passed into the layout.

I had this exact same problem in the past and it was my fault as I was passing the empty String into my then layout. After changing my "" to " " above error went away.

 

Hope this will help you in resolving your issue.

9 7 4
38,600 points

Related questions

0 votes
1 answer 343 views
343 views
Problem : I am trying to learn Android programming also I am trying to develop a very basic weather app. My code works perfectly if I try to enter any valid city name. But I want to use the toast and it shows me the error and also to the ... .nextCleanInternal(JSONTokener.java:116) at org.json.JSONTokener.nextValue(JSONTokener.java:94) at org.json.JSONObject. How can I fix the above error?
asked Feb 14 mphil 2.3k points
0 votes
2 answers 108 views
108 views
Problem : Currently I am working on my app for Android but I am getting following error while working with the SharedPreferences. I am very new to Android App Programming. I am trying to debug it from past 2 days but unable to find the solution ... " android:inputType="number" android:key="capitalownership" android:title="@string/capitalownership" /> Can somebody help me in resolving this error?
asked Feb 17 mphil 2.3k points
0 votes
1 answer 86 views