Package 

Class ContextUtils


  • 
    public class ContextUtils
    
                        

    Class containing static methods involving manipulations of Contexts and their related subclasses.

    • Method Summary

      Modifier and Type Method Description
      static <T> T findContextOfType(@Nullable() Context context, Class<out T> clazz) Returns the nearest context in the chain (as defined by ContextWrapper.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • findContextOfType

        @Nullable() static <T> T findContextOfType(@Nullable() Context context, Class<out T> clazz)

        Returns the nearest context in the chain (as defined by ContextWrapper.getBaseContext()) whichis an instance of the specified type, or null if one could not be found

        Parameters:
        context - Initial context
        clazz - Class instance to look for