com.ibm.security.access.mobile.authentication

Class ContextHelper

  • java.lang.Object
    • com.ibm.security.access.mobile.authentication.ContextHelper


  • public final class ContextHelper
    extends java.lang.Object
    Helper class to provide SDK wide access to the Context of the application, without the need to pass it to every other class that needs it.

    The context of your application has to be set in setContext(Context) once before any other class is used.

    Since:
    1.2.0
    Version:
    1.2.8
    • Method Detail

      • setContext

        public void setContext(android.content.Context context)
        Stores the context of the application and make it available within the SDK.
        Parameters:
        context - the context of the application
        Throws:
        java.lang.IllegalArgumentException - if passed context is null
        Note:
        This method should be called as early as possible within your application! It will retrieve the application context from the provided context, so you can pass an activity's Context.
      • getContext

        public android.content.Context getContext()
                                           throws java.lang.IllegalStateException
        Returns the context of the application.
        Returns:
        the application context
        Throws:
        java.lang.IllegalStateException - if context is null