Example usage for org.apache.cordova CordovaPreferences getString

List of usage examples for org.apache.cordova CordovaPreferences getString

Introduction

In this page you can find the example usage for org.apache.cordova CordovaPreferences getString.

Prototype

public String getString(String name, String defaultValue) 

Source Link

Usage

From source file:org.crosswalk.engine.XWalkCordovaWebViewImpl.java

License:Apache License

public static CordovaWebViewEngine createEngine(Context context, CordovaPreferences preferences) {
    String className = preferences.getString("webview", XWalkWebViewEngine.class.getCanonicalName());
    try {/*from  w ww  .j  a va 2 s .  c  o m*/
        Class<?> webViewClass = Class.forName(className);
        Constructor<?> constructor = webViewClass.getConstructor(Context.class, CordovaPreferences.class);
        return (CordovaWebViewEngine) constructor.newInstance(context, preferences);
    } catch (Exception e) {
        throw new RuntimeException("Failed to create webview. ", e);
    }
}