@ SuppressWarnings ( "unchecked" ) public static Class < ? extends Application > getClassFromStaticMethod ( final int classDeepLevel ) { Class < ? extends Application > clazz = null ; try { clazz = ( Class < ? extends Application > ) Class . forName ( Thread . currentThread ( ) . getStackTrace ( ) [ classDeepLevel ] . getClassName ( ) ) ; } catch ( final ClassNotFoundException e ) { clazz = null ; } return clazz ; }
Return the class used by the Nth level of the current call stack .