本文整理汇总了Java中org.apache.cordova.Config.init方法的典型用法代码示例。如果您正苦于以下问题:Java Config.init方法的具体用法?Java Config.init怎么用?Java Config.init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cordova.Config
的用法示例。
在下文中一共展示了Config.init方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import org.apache.cordova.Config; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
LayoutInflater localInflater = inflater.cloneInContext(new CordovaContext(getActivity(), this));
View rootView = localInflater.inflate(R.layout.fragment_cordova, container, false);
myWebView = (CordovaWebView) rootView.findViewById(R.id.myWebView);
myWebView.setBackgroundColor(Color.argb(1, 0, 0, 0));
// fixes a bug in android 3.0 - 4.0.3 that causes an issue with transparent webviews.
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB
&& android.os.Build.VERSION.SDK_INT <= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
myWebView.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null);
}
Config.init(getActivity());
myWebView.loadUrl(Config.getStartUrl());
return rootView;
}
示例2: onCreate
import org.apache.cordova.Config; //导入方法依赖的package包/类
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//CB-7238: This has to be added now, because it got removed from somewhere else
Config.init(this);
cordovaWebView = (CordovaWebView) findViewById(R.id.cordovaWebView);
cordovaWebView.init(this, new CordovaWebViewClient(this, cordovaWebView), new CordovaChromeClient(this, cordovaWebView),
Config.getPluginEntries(), Config.getWhitelist(), Config.getExternalWhitelist(), Config.getPreferences());
cordovaWebView.loadUrl("file:///android_asset/www/index.html");
}
示例3: loadConfig
import org.apache.cordova.Config; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
protected void loadConfig() {
ConfigXmlParser parser = new ConfigXmlParser();
parser.parse(getActivity());
preferences = parser.getPreferences();
preferences.setPreferencesBundle(getActivity().getIntent().getExtras());
//preferences.set("webview", "io.syng.cordova.plugin.WebViewEngine");
pluginEntries = parser.getPluginEntries();
Config.init(getActivity());
}
示例4: onCreate
import org.apache.cordova.Config; //导入方法依赖的package包/类
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// AWV Factory should be initialized before setting the layout
if (!sFactoryInit) {
factory = AmazonWebKitFactories.getDefaultFactory();
if (factory.isRenderProcess(this)) {
return; // Do nothing if this is on render process
}
factory.initialize(this);
sFactoryInit = true;
} else {
factory = AmazonWebKitFactories.getDefaultFactory();
}
setContentView(R.layout.main);
//CB-7238: This has to be added now, because it got removed from somewhere else
Config.init(this);
cordovaWebView = (CordovaWebView) findViewById(R.id.cordovaWebView);
factory.initializeWebView(cordovaWebView, 0xFFFFFF, false, null);
cordovaWebView.init(this, new CordovaWebViewClient(this, cordovaWebView), new CordovaChromeClient(this, cordovaWebView),
Config.getPluginEntries(), Config.getWhitelist(), Config.getExternalWhitelist(), Config.getPreferences());
cordovaWebView.loadUrl("file:///android_asset/www/index.html");
}