This is my problem :
Im trying to read a HTML file from asset folder but
i've got this error :
file:/android_asset/Tuberculin.html: open failed: ENOENT (No such file or directory)
In my class am extending BaseAdapter
public class medic_ListViewAdapter extends BaseAdapter {
and this is my code :
String path = "file:///android_asset/Tuberculin.html";
final Scanner scanner= new Scanner(new File(path));
int i =0;
while (scanner.hasNextLine()) {
i++;
String lineFromFile = scanner.nextLine();
if(lineFromFile.toLowerCase(Locale.getDefault()).contains(search)) {
String a= String.valueOf(i);
// a match!
yes=true;
scanner.close();
break;
}
}
scanner.close();
Is there a way to read asset files without extending activity ?