Sunday, 15 January 2012

Android problem: cannot find text file under assets


I put symp.txt under assets and use the following code to load it:

    AssetManager am = context.getAssets();
    InputStream is;
try {
    is = am.open("symp.txt");
    mCategory = new SymptomCategory(is);
} catch (IOException e) {
    e.printStackTrace();
}

However I got exception when opening the file.

The problem was fixed by cleaning up the project and let it auto recompile.

No comments:

Post a Comment