.getExternalStorageDirectory(), destFile)));
}
} catch (MalformedURLException e) {
- throw new RuntimeException(e);
+ throw new RuntimeException("Download manager refuses download URL!", e);
}
downloadManager.enqueue(request);
downloadButton.setText("X");
// No way to get pure UTF-8 data into WebView\r
html = Base64.encodeToString(html.getBytes("UTF-8"), Base64.DEFAULT);\r
} catch (UnsupportedEncodingException e) {\r
- throw new RuntimeException(e);\r
+ throw new RuntimeException("Missing UTF-8 support?!", e);\r
}\r
// Use loadURL to allow specifying a charset\r
webView.loadUrl("data:text/html;charset=utf-8;base64," + html);\r
try {
html = new String(data.get(index), "UTF-8");
} catch (UnsupportedEncodingException e) {
- throw new RuntimeException(e);
+ throw new RuntimeException("Dictionary HTML data corrupted", e);
}
htmlRef = new SoftReference<String>(html);
return html;
raf.seek(offset);
raf.read(zipBytes);
} catch (IOException e) {
- throw new RuntimeException(e);
+ throw new RuntimeException("Failed to read HTML data from dictionary", e);
}
}
try {
final byte[] bytes = StringUtil.unzipFully(zipBytes, numBytes);
html = new String(bytes, "UTF-8");
} catch (IOException e) {
- throw new RuntimeException(e);
+ throw new RuntimeException("Dictionary HTML data corrupted", e);
}
htmlRef = new SoftReference<String>(html);
return html;