Closed GoogleCodeExporter closed 8 years ago
Hi arun.vc...,
your posted issue is more a "How To use..." question and not a classical issue.
If you have any questions like yours, please ask them on the CEF-Forum
(http://www.magpcss.org/ceforum/index.php).
Anyway a short answer here:
What kind of "small changes"? As the exception says, CefSettings can only be
passed to CefApp if it is in state "NONE" or "NEW". Otherwise it doesn't make
sense because the settings are only handled on initial startup.
Call CefApp.getInstance(CefSettings settings) or CefApp.getInstance(String[]
args, CefSettings settings) only once at startup. After that just call
CefApp.getInstance() in your code if you need an instance of CefApp.
You can use for example the following code-snippet in your App-Initialization:
CefSettings mySettings = new CefSettings();
mySettings....; // make your settings here
CefApp myApp = CefApp.getInstance();
myApp. setSettings(mySettings);
or somewhat shorter::
CefApp.getInstance(mySettings);
After that you should just call getInstance() without any parameters in the
rest of your code:
CefClient myClient = CefApp.getInstance().createClient(...);
Another way would be to use a try-catch clause if you want to use the same
initial code snippet several times:
CefApp app = null;
CefSettings mySettings = ...;
try {
app = CefApp.getInstance(mySettings);
} catch (IllegalStateException e) {
app = CefApp.getInstance();
}
app.createClient().createBrowser(...);
Hope this helps, or did I miss your point?
Regards,
Kai
Original comment by k...@censhare.de
on 30 Oct 2014 at 6:16
Thanks Kai for clarifying. I'll try out like you suggested and post the "How to
use.." question in the CEF-Forum (http://www.magpcss.org/ceforum/index.php)
henceforth.
Original comment by arun.vc....@gmail.com
on 30 Oct 2014 at 6:22
Original comment by magreenb...@gmail.com
on 30 Oct 2014 at 5:54
Original issue reported on code.google.com by
arun.vc....@gmail.com
on 29 Oct 2014 at 2:24