本文整理匯總了Java中org.apache.cordova.engine.SystemWebViewEngine類的典型用法代碼示例。如果您正苦於以下問題:Java SystemWebViewEngine類的具體用法?Java SystemWebViewEngine怎麽用?Java SystemWebViewEngine使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SystemWebViewEngine類屬於org.apache.cordova.engine包,在下文中一共展示了SystemWebViewEngine類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createEngine
import org.apache.cordova.engine.SystemWebViewEngine; //導入依賴的package包/類
public static CordovaWebViewEngine createEngine(Context context, CordovaPreferences preferences) {
String className = preferences.getString("webview", SystemWebViewEngine.class.getCanonicalName());
try {
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);
}
}
示例2: onCreate
import org.apache.cordova.engine.SystemWebViewEngine; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//Set up the webview
ConfigXmlParser parser = new ConfigXmlParser();
parser.parse(this);
SystemWebView webView = (SystemWebView) findViewById(R.id.cordovaWebView);
webInterface = new CordovaWebViewImpl(new SystemWebViewEngine(webView));
webInterface.init(cordovaInterface, parser.getPluginEntries(), parser.getPreferences());
webView.loadUrl(parser.getLaunchUrl());
}