X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=src%2Fcom%2Fhughes%2Fandroid%2Fdictionary%2FHtmlDisplayActivity.java;h=b174da636ecd25a280cade683711217ab9570e53;hb=2e8e801d4538ab26392361e23a7a0f1131b73c2c;hp=dd07c4e7dd975a88b4d11459f433afa2c929b67a;hpb=f83ff233e48df1acfe2a3cad2f56a89072fde946;p=Dictionary.git diff --git a/src/com/hughes/android/dictionary/HtmlDisplayActivity.java b/src/com/hughes/android/dictionary/HtmlDisplayActivity.java index dd07c4e..b174da6 100644 --- a/src/com/hughes/android/dictionary/HtmlDisplayActivity.java +++ b/src/com/hughes/android/dictionary/HtmlDisplayActivity.java @@ -28,6 +28,8 @@ import android.widget.Button; import com.hughes.util.StringUtil; +import java.io.IOException; +import java.io.InputStream; import java.io.UnsupportedEncodingException; public final class HtmlDisplayActivity extends ActionBarActivity { @@ -74,7 +76,12 @@ public final class HtmlDisplayActivity extends ActionBarActivity { final int htmlRes = getIntent().getIntExtra(HTML_RES, -1); String html; if (htmlRes != -1) { - html = StringUtil.readToString(getResources().openRawResource(htmlRes)); + InputStream res = getResources().openRawResource(htmlRes); + html = StringUtil.readToString(res); + try { + res.close(); + } catch (IOException e) { + } } else { html = getIntent().getStringExtra(HTML); }