• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Substring not working on setText()

stubbzj12

Newbie
Find this really, really weird:

Java:
//Returns string...
        String category = db.getCategoryNameById(currentTask.getCategory());

        if (category.length() > 10) {
            //This works fine. Printing categor... Cutting the string up and adding ...
            Log.d("TEST", category.substring(0, 6) + "...");
           
            //Not working... Setting the full string and not cutting up the string
            vCategory.setText(category.substring(0, 6) + "...");
        }
 
Are you sure you pasted the correct code? You're using substring() on both lines.
 
Sorry for the long reply mate. Yeah it's fixed. I have no idea what was wrong, but I came back to it after a while and tried again and it worked.
 
Last edited:
Back
Top Bottom