I'm trying to open a .pdf within my app. The .pdf file is embedded with my app and it will be shipped within the "assets" folder (or any other folder, if that works). The file can be opened directly in Eclipse and it can be found in the finder (mac) inside the assets folder....so I know it's there.
In my code I have this:
AssetManager assetManager = getAssets();
String[] files = null;
try
{
files = assetManager.list("");
}
catch (IOException e1)
{
e1.printStackTrace();
}
System.out.println("file = " + files[1]);
File file = new File(files[1]);
if (file.exists())
{
// some code to open the .pdf file
}
Tho log shows the file name as "file = privacy.pdf" (my file) but the file.exists() always returns false.
Any idea on what I'm doing wrong? Thank you very much.