Hello,

I am wondering whether 'substring' support is there or not on Android 1.1 
minimum SDK set in Eclipse project. Actually i installed Android 1.6 SDK.
I use the following parse function, where-in i use 'substring' for few places. 
I am not getting any result from the 'substring' code and it jumps to 
Timer.class file to show 'The JAR of this class file belongs to 'Android 1.1 
which does not allow modifications to source attachments on its entities' etc. 
message, when debugging 'substring' line of code. 
I don't know why it is not executing 'substring' line of code in my below 
function and jumps to show such message like that to me?
Note: This function is under Timer running code.

private String parseContentsString(String inputDataStr)
    {
        String parsedOutput = null;
        int i = 0;
        int nameIndEnd = 0;
        int startIndex = 0;
        int endIndex = 0;
        
        i = inputDataStr.indexOf("TickerTxt>");
        if (i != -1)
        {
            nameIndEnd = inputDataStr.indexOf(" ", i);
            if (nameIndEnd > 0)
            {
                startIndex = i + 10;
                endIndex = nameIndEnd - startIndex;
                parsedOutput += "      ";
                parsedOutput = inputDataStr.substring(startIndex, endIndex);
                parsedOutput += " ";
            }
        }
        while ((i = inputDataStr.indexOf("name=", i)) != -1)
        {
            nameIndEnd = inputDataStr.indexOf("target=", i);
            startIndex = i + 5;
            endIndex = (nameIndEnd - 2) - startIndex;
            if (i > 0 && nameIndEnd > 0)
            {
                parsedOutput += inputDataStr.substring(startIndex, endIndex);
                parsedOutput += " ";
            }
            i = inputDataStr.indexOf("<B>", i);
            startIndex = i + 3;
            nameIndEnd = inputDataStr.indexOf("</B>", i);
            endIndex = nameIndEnd - startIndex;
            if (i > 0 && nameIndEnd > 0)
            {
                parsedOutput += inputDataStr.substring(startIndex, endIndex);
                parsedOutput += " ";
            }          
            i = inputDataStr.indexOf("font color=", i);
            i = inputDataStr.indexOf(">", i);
            startIndex = i + 1;
            nameIndEnd = inputDataStr.indexOf(" ", i);
            endIndex = nameIndEnd - startIndex;
            if (i > 0 && nameIndEnd > 0)
            {
                parsedOutput += inputDataStr.substring(startIndex, endIndex);
                parsedOutput += " ";
            }           
            i = inputDataStr.indexOf("  ", i);
            startIndex = i + 12;
            nameIndEnd = inputDataStr.indexOf("%]", i);
            endIndex = (nameIndEnd + 2) - startIndex;
            if (i > 0 && nameIndEnd > 0)
            {
                parsedOutput += inputDataStr.substring(startIndex, endIndex);
                parsedOutput += " ; ";
            }
            i++;
        }
        return parsedOutput;
    }
    
Could someone help me on get rid of this problem and to execute 'substring' 
successfully?


Martin.



      

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to