private String shortenTitle(String title){
  if (title.equals("")) {
    return "Tests' root dir:";
  }
  int charCount=mListView.getWidth() / MEAN_TITLE_CHAR_SIZE;
  if (title.length() > charCount) {
    return "..." + title.substring(title.length() - charCount);
  }
 else {
    return title;
  }
}

private String shortenTitle ( String title ) { if ( title . equals ( "" ) ) { return "Tests' root dir:" ; } int charCount = mListView . getWidth ( ) / MEAN_TITLE_CHAR_SIZE ; if ( title . length ( ) > charCount ) { return "..." + title . substring ( title . length ( ) - charCount ) ; } else { return title ; } }
todo : find a neat way to determine number of characters that fit in the title bar .
