diff options
| author | 2009-08-18 13:35:55 -0700 | |
|---|---|---|
| committer | 2009-08-18 13:35:55 -0700 | |
| commit | 72e4bcd3d0da90f6c9550c93e58c12b2903a5ab8 (patch) | |
| tree | bffd42883e1f457bcd8d502aa6e4f64538211b62 | |
| parent | 238f8fe645271a0ef891553e1c8c3c964c3c876d (diff) | |
Fix Resources#opeRawResource(int, TypedValue) in layoutlib.
| -rw-r--r-- | tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeResources.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeResources.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeResources.java index 8a040e41d772..2b0100b72418 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeResources.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeResources.java @@ -497,6 +497,24 @@ public final class BridgeResources extends Resources { } @Override + public InputStream openRawResource(int id, TypedValue value) throws NotFoundException { + getValue(id, value, true); + + File f = new File(value.string.toString()); + if (f.isFile()) { + try { + return new FileInputStream(f); + } catch (FileNotFoundException e) { + NotFoundException exception = new NotFoundException(); + exception.initCause(e); + throw exception; + } + } + + throw new NotFoundException(); + } + + @Override public AssetFileDescriptor openRawResourceFd(int id) throws NotFoundException { throw new UnsupportedOperationException(); } |