Example usage for org.apache.cordova CordovaPlugin privateInitialize

List of usage examples for org.apache.cordova CordovaPlugin privateInitialize

Introduction

In this page you can find the example usage for org.apache.cordova CordovaPlugin privateInitialize.

Prototype

public final void privateInitialize(String serviceName, CordovaInterface cordova, CordovaWebView webView,
        CordovaPreferences preferences) 

Source Link

Document

Call this after constructing to initialize the plugin.

Usage

From source file:plugin.google.maps.GoogleMaps.java

@SuppressWarnings("rawtypes")
private void loadPlugin(String serviceName) {
    if (plugins.containsKey(serviceName)) {
        return;/*from w w w. j av  a2 s. c o m*/
    }
    try {
        String className = "plugin.google.maps.Plugin" + serviceName;
        Class pluginCls = Class.forName(className);

        CordovaPlugin plugin = (CordovaPlugin) pluginCls.newInstance();
        PluginEntry pluginEntry = new PluginEntry("GoogleMaps", plugin);
        this.plugins.put(serviceName, pluginEntry);

        plugin.privateInitialize(className, this.cordova, webView, null);

        plugin.initialize(this.cordova, webView);
        ((MyPluginInterface) plugin).setMapCtrl(this);
        if (map == null) {
            Log.e(TAG, "map is null!");
        }

    } catch (Exception e) {
        e.printStackTrace();
    }
}