I've got this function:
public static String read(Context context) {
FileInputStream fis;
try {
fis = context.openFileInput(INFO_FILE_NAME);
int bufferSize = 2 * 1024 * 1024; // 2 MiB
byte[] buffer = new byte[bufferSize];
fis.read(buffer);
return new String(buffer);
} catch (Exception e) {
Log.d(TAG,
"Exception while reading General Information File:"
+ e.getMessage());
return null;
}
}
The function returns null. This means that there was an exception. However, nothing is logged to LogCat.
I've tried to debug it with Eclipse. Everything goes ok until the "return new String(buffer);" line. When I try to execute it, the debuggers jumps directly to the "return null;" line, without going through the "Log.d". In addition, when I'm in the "return null;" line, I can't see in the debugger the variable "e". How can this happen?