question: public static String stripSuffix ( String name , String suffix , boolean recursiveStrip ) { if ( name . length ( ) < 2 ) { return name ; } int suffixStart = name . lastIndexOf ( suffix . charAt ( 0 ) ) ; if ( suffixStart != - 1 && name . regionMatches ( suffixStart , suffix , 0 , name . length ( ) - suffixStart ) ) { name = name . substring ( 0 , suffixStart ) ; } if ( recursiveStrip && name . endsWith ( suffix ) ) { return stripSuffix ( name , suffix , recursiveStrip ) ; } return name ; }
target:  Strip off the end portion of the name. The user might be typing the activity name such that only a portion has been entered so far (e.g. "MainActivi") and we want to chop off that portion too such that we don't offer a layout name partially containing the activity suffix (e.g. "main_activi").