webview: try to trap runtimeexception

This commit is contained in:
Andrew Dolgov 2011-12-07 15:13:58 +03:00
parent 175c703650
commit 59839b7e08
2 changed files with 10 additions and 2 deletions

View File

@ -126,7 +126,11 @@ public class ArticleFragment extends Fragment implements OnClickListener {
"</head>" + "</head>" +
"<body>" + m_article.content + "</body></html>"; "<body>" + m_article.content + "</body></html>";
web.loadDataWithBaseURL(null, content, "text/html", "utf-8", null); try {
web.loadDataWithBaseURL(null, content, "text/html", "utf-8", null);
} catch (RuntimeException e) {
e.printStackTrace();
}
if (m_onlineServices.isSmallScreen()) if (m_onlineServices.isSmallScreen())
web.setOnTouchListener(m_gestureListener); web.setOnTouchListener(m_gestureListener);

View File

@ -162,7 +162,11 @@ public class OfflineArticleFragment extends Fragment implements OnClickListener
"</head>" + "</head>" +
"<body>" + articleContent + "</body></html>"; "<body>" + articleContent + "</body></html>";
web.loadDataWithBaseURL(null, content, "text/html", "utf-8", null); try {
web.loadDataWithBaseURL(null, content, "text/html", "utf-8", null);
} catch (RuntimeException e) {
e.printStackTrace();
}
if (m_offlineServices.isSmallScreen()) if (m_offlineServices.isSmallScreen())
web.setOnTouchListener(m_gestureListener); web.setOnTouchListener(m_gestureListener);