import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
-import android.preference.PreferenceManager;
+import android.support.v7.preference.PreferenceManager;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.util.Base64;
html = StringUtil.readToString(res);
try {
res.close();
- } catch (IOException e) {
+ } catch (IOException ignored) {
}
} else {
html = getIntent().getStringExtra(HTML);
webView.getSettings().setDefaultFontSize(fontSizeSp);
try {
// No way to get pure UTF-8 data into WebView
+ // Cannot use StandardCharsets due to older Android.
html = Base64.encodeToString(html.getBytes("UTF-8"), Base64.DEFAULT);
} catch (UnsupportedEncodingException e) {
throw new RuntimeException("Missing UTF-8 support?!", e);