try {
File f = new File("file:///android_asset/[2011]011TAXMANN.COM00167(PATNA)") ;
FileInputStream fis= new FileInputStream(f);
System.out.println("_______YOUR HTML CONTENT CODE IS BELLOW WILL BE PRINTED IN 2 SECOND _______");
Thread.sleep(2000);
int ch;
while((ch=fis.read())!=-1)
{
fileContent=fileContent+(char)ch; // here i stored the content of .Html file in fileContent variable
}
System.out.print(fileContent);
//}
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
这是我的代码。我想从asstes文件夹读取html内容我的文件在asstes文件夹中可用但它给出例外FileNotFoundException
。所以PLZ任何一个告诉我如何阅读Android中的asstes文件夹的HTML内容?如何从android资源文件夹中读取html内容
File f = new File(“file:/// android_asset/[2011] 011TAXMANN.COM00167(PATNA)”); 当调试F给出=文件:/ android_asset/[2011] 011TAXMANN.COM00167(巴特那)
PLZ告诉我怎么去CORRCT目录并且是即时做错了它shud我走来文件:/// android_asset/[ 2011] 011TAXMANN.COM00167(巴特那)
文件f =新的文件(“/文件:/ //android_asset/[2011]011TAXMANN.COM00167(PATNA)“); – Joan 2011-12-22 11:37:00
无法做到这一点,我想要读取该文件的内容不显示.. – Joan 2011-12-22 11:40:56
你是什么意思,你想阅读标记值 – Sameer 2011-12-22 11:43:59