Class ShadowWebSettings


  • @Implements(android.webkit.WebSettings.class)
    public class ShadowWebSettings
    extends java.lang.Object
    Shadow of WebSettings which returns a dummy user a stub instance rather than the User-Agent used by a WebView.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      protected static java.lang.String getDefaultUserAgent​(android.content.Context context)
      Returns the default User-Agent used by a WebView.
      static void reset()  
      static void setDefaultUserAgent​(java.lang.String defaultUserAgent)
      Sets the default user agent for the WebView.
      • Methods inherited from class java.lang.Object

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

      • ShadowWebSettings

        public ShadowWebSettings()
    • Method Detail

      • getDefaultUserAgent

        @Implementation(minSdk=18)
        protected static java.lang.String getDefaultUserAgent​(android.content.Context context)
        Returns the default User-Agent used by a WebView. An instance of WebView could use a different User-Agent if a call is made to WebSettings.setUserAgentString(String).
        Parameters:
        context - a Context object used to access application assets
      • setDefaultUserAgent

        public static void setDefaultUserAgent​(java.lang.String defaultUserAgent)
        Sets the default user agent for the WebView. The value set here is returned from getDefaultUserAgent(Context).
      • reset

        @Resetter
        public static void reset()