# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Nested Classes | Methods | Inherited Methods

# GeolocationPermissions

`public class GeolocationPermissions`
`extends Object` ``

java.lang.Object
↳ | android.webkit.GeolocationPermissions

This class is used to manage permissions for the WebView's Geolocation JavaScript API. Geolocation permissions are applied to an origin, which consists of the host, scheme and port of a URI. In order for web content to use the Geolocation API, permission must be granted for that content's origin. This class stores Geolocation permissions. An origin's permission state can be either allowed or denied. This class uses Strings to represent an origin. When an origin attempts to use the Geolocation API, but no permission state is currently set for that origin, `WebChromeClient.onGeolocationPermissionsShowPrompt()` is called. This allows the permission state to be set for that origin. The methods of this class can be used to modify and interrogate the stored Geolocation permissions at any time.

## Summary

### Nested classes
`interface` | `GeolocationPermissions.Callback` A callback interface used by the host application to set the Geolocation permission state for an origin.

### Public methods
`void` | `allow(String origin)` Allows the specified origin to use the Geolocation API.
`void` | `clear(String origin)` Clears the Geolocation permission state for the specified origin.
`void` | `clearAll()` Clears the Geolocation permission state for all origins.
`void` | `getAllowed(String origin, ValueCallback<Boolean> callback)` Gets the Geolocation permission state for the specified origin.
`static GeolocationPermissions` | `getInstance()` Gets the singleton instance of this class.
`void` | `getOrigins(ValueCallback<Set<String>> callback)` Gets the set of origins for which Geolocation permissions are stored.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Public methods

### allow

    public void allow (String origin)

Allows the specified origin to use the Geolocation API.

Parameters
`origin` | `String`: the origin for which Geolocation API use is allowed

### clear

    public void clear (String origin)

Clears the Geolocation permission state for the specified origin.

Parameters
`origin` | `String`: the origin for which Geolocation permissions are cleared

### clearAll

    public void clearAll ()

Clears the Geolocation permission state for all origins.

### getAllowed

    public void getAllowed (String origin,
                    ValueCallback<Boolean> callback)

Gets the Geolocation permission state for the specified origin.

Parameters
`origin` | `String`: the origin for which Geolocation permission is requested
`callback` | `ValueCallback`: a `ValueCallback` to receive the result of this request. This object's `onReceiveValue()` method will be invoked asynchronously with a boolean indicating whether or not the origin can use the Geolocation API.

### getInstance

    public static GeolocationPermissions getInstance ()

Gets the singleton instance of this class. This method cannot be called before the application instantiates a `WebView` instance.

Returns
`GeolocationPermissions` | the singleton `GeolocationPermissions` instance

### getOrigins

    public void getOrigins (ValueCallback<Set<String>> callback)

Gets the set of origins for which Geolocation permissions are stored.

Parameters
`callback` | `ValueCallback`: a `ValueCallback` to receive the result of this request. This object's `onReceiveValue()` method will be invoked asynchronously with a set of Strings containing the origins for which Geolocation permissions are stored.

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*