While reading from file under Assets/sb/example/simple.html/It is giving filenotfound exception.
11-01 18:30:13.562: WARN/System.err(912): java.io.FileNotFoundException: file:///android_asset/sb/example/simple.html
Code Snippet is
try {
final AssetManager assetMgr = ctx.getResources().getAssets();
is = assetMgr.open(path, AssetManager.ACCESS_STREAMING);
// is = getAssets().open(file.getAbsolutePath());
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
Here I had given full path of the asset folder but in assets it takes relative path.
try {
final AssetManager assetMgr = ctx.getResources().getAssets();
is = assetMgr.open("sb/example/simple1.html");
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
It is working....
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With