Example usage for org.apache.cordova.whitelist WhitelistPlugin WhitelistPlugin

List of usage examples for org.apache.cordova.whitelist WhitelistPlugin WhitelistPlugin

Introduction

In this page you can find the example usage for org.apache.cordova.whitelist WhitelistPlugin WhitelistPlugin.

Prototype

public WhitelistPlugin(XmlPullParser xmlParser) 

Source Link

Usage

From source file:org.apache.appharness.AppHarnessUI.java

License:Apache License

private CordovaPlugin createWhitelistPlugin(Uri configXmlUri) {
    InputStream istr = null;/*from   www  . j  a va2s.  c  o m*/
    try {
        istr = new FileInputStream(configXmlUri.getPath());
        XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
        factory.setNamespaceAware(false);
        XmlPullParser parser = factory.newPullParser();
        parser.setInput(istr, "UTF-8");
        return new WhitelistPlugin(parser);
    } catch (XmlPullParserException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    } finally {
        if (istr != null) {
            try {
                istr.close();
            } catch (IOException e) {
            }
        }
    }
    return null;
}