Android Utililty Methods Class Name Get

List of utility methods to do Class Name Get

Description

The list of methods to do Class Name Get are organized into topic(s).

Method

StringextractPartialClassName(String className, int parts)
Extract a partial name of a class name, starting from the end.
String partialCategoryName = className;
int nofDots = 0;
int dotIndex = className.lastIndexOf('.');
if (dotIndex != -1) {
    nofDots++;
while (nofDots < parts && dotIndex > -1) {
    dotIndex = className.lastIndexOf('.', dotIndex - 1);
...
StringcreateValidClassName(String str)
create Valid Class Name
String valid = str.replace(" ", "");
valid = valid.replace(":", "");
valid = valid.replace("-", "");
valid = valid.replace(",", "");
return valid;
StringgetClassName()
get Class Name
return new Exception().getStackTrace()[0].getClassName();