var win = Ti.UI.createWindow({
backgroundColor: '#ccc'
});
var webView = Ti.UI.createWebView({ url: "http://www.google.com" });
webView.addEventListener("load", function() {
Ti.API.info("webView loaded");
setInterval(doSomething, 1000);
});
win.add(webView);
win.open();
function doSomething() {
Ti.API.info("interval triggered");
try {
var result = webView.evalJS("1+1");
Ti.API.info("RESULT: " + result);
} catch(e) {
Ti.API.info("ERROR: " + e);
}
}
1. Launch the code snippet
2. Browse to a different web page, and hit the 'back' button when the page is loading
3. Immediately launch the app again once the app closes.
(This is some kind of race condition and happens intermittently. You may need to try several times)
Do you get "[INFO][TiRootActivity( 518)] (main) [0,0] checkpoint, on root activity create, savedInstanceState: null" ?
That message is debug info that shows up quite often, and is not related to this issue.
In my application all the time I close and try immediatly to open the application it crashes and I get that savedInstanceState null and a SIGSEGV error. I'm trying to figure out if this is the same bug you are experiencing... My log on DDMS while running on a device (LG P500 Android 2.3.7): http://pastebin.com/8ihM1GM8
@Ricardo From the logs, I'm not sure if it's the same bug you experiencing. I am submitting a PR for this, so you can test it out. If you are still having problems, please narrow it down to a simple test case and submit a separate bug. Thanks, Allen
PR Ready: https://github.com/appcelerator/titanium_mobile/pull/2653 To test, run the test case above. NOTE: Before my fix, the app would freeze and then ultimately crash. After my fix, the app may stay on the splash screen for a short time, and then recover (loading the app successfully). Also when you hit the fail case (after you relaunch the app successfully) you may notice that RESULT is null in the logs. This is a result of us getting the load event from the previous instance of the app and is a separate bug. When you hit this situation, you should back out of the app and verify that all the logging from the app stops (Before my fix, this used to keep on going after you back out of an app).
Closing as fixed. Tested and verified on: Titanium Studio, build: 2.1.1.201208091713 Titanium SDK, build: 2.2.0.v20120813184911 Devices: Nexus 7 tab (4.1), HTC Evo (4.0.3) Can't get crashes on app restart.
Reopening to update labels.