• 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
Nov 12, 2017
26
12
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) + "...");
        }
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones