Package 

Class AndroidContexts

    • Method Detail

      • hasPermission

         static boolean hasPermission(Context ctxt, String perm)

        Test whether a permission has been granted.

        Parameters:
        ctxt - context to test
        perm - permission to test for
      • hasAllPermissions

         static boolean hasAllPermissions(Context ctxt, Array<String> perms)

        Test whether all permissions have been granted.

        Parameters:
        ctxt - context to test
        perms - permissions to test for
      • hasAnyPermissions

         static boolean hasAnyPermissions(Context ctxt, Array<String> perms)

        Test whether any permissions have been granted.

        Parameters:
        ctxt - context to test
        perms - permissions to test for
      • hasSystemFeature

         static boolean hasSystemFeature(Context ctxt, String feat)

        Test whether a system feature is present.

        Parameters:
        ctxt - context to test
        feat - feature to test for
      • systemServiceOf

         static <T> T systemServiceOf(Context ctxt, Class<T> type, String name)

        Retrieve system service from a context.

        Parameters:
        ctxt - context to retrieve from
        type - service type class
        name - service name
      • withSystemService

         static <T, R> R withSystemService(Context ctxt, Class<T> type, String name, Function<T, R> op)

        Apply operation on system service, if available.

        Parameters:
        ctxt - context to retrieve from
        type - service type class
        name - service name
        op - operation to perform
      • withSystemService

         static <T, R> R withSystemService(Context ctxt, Class<T> type, String name, Function<T, R> op, R dfl)

        Apply operation on system service, if available, or return default value.

        Parameters:
        ctxt - context to retrieve from
        type - service type class
        name - service name
        op - operation to perform
        dfl - default value to return