Permalink
Browse files

Work-around for missing Base64 support on Eclair.

  • Loading branch information...
1 parent 42216b6 commit 0a8a7907de13733a0f8d90c73a84e26a12eb0ad2 @NightWhistler committed Apr 19, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/main/java/net/nightwhistler/pageturner/activity/CatalogActivity.java
@@ -470,7 +470,12 @@ private void loadImageLink( Link imageLink, String baseUrl ) throws IOException
if ( href.startsWith("data:image/png;base64")) {
String dataString = href.substring( href.indexOf(',') + 1 );
- imageLink.setBinData( Base64.decode(dataString, Base64.DEFAULT ));
+ try {
+ imageLink.setBinData( Base64.decode(dataString, Base64.DEFAULT ));
+ } catch ( NoClassDefFoundError ncd ) {
+ //Slight hack for Android 2.1
+ imageLink.setBinData(null);
+ }
} else {
String target = new URL(new URL(baseUrl), href).toString();

0 comments on commit 0a8a790

Please sign in to comment.