LeafletJS and Android WebView crash on first startup

After one month of crazy panic to get my jquerymobile/leafletjs application working on a webview in Android without crash on first run, I found the solution:

// Magic code
webView.freeMemory();
webView.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null);

I hope could be useful for someone.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: