Class Context


  • public class Context
    extends java.lang.Object
    Wrapper for the Android class android.content.Context.
    • Method Detail

      • getApplicationContext

        @Nullable
        public static Context getApplicationContext()
        Performs reflection to see if the android.content.Context class is available at runtime. If so, this method will return an instance of this class.
        Returns:
        an instance of this class if invoked within an Android environment, otherwise, null
      • getPackageName

        @Nullable
        public java.lang.String getPackageName()
        Returns:
        the package name of the Android app if available, otherwise, null