NullPointer exception in ContextWrapper
问题 I have a class called FileGeneration that extends Activity In FileGeneration I have a method called protected OutputStream openAndWriteFile() { // Set the Context-mode int cxt = Context.MODE_PRIVATE; // Check if we are not going to clear the file and the file exists if (!clearFile && (new File(this.fileName)).exists()) { // Append to the file cxt = Context.MODE_APPEND; } // Try to open the file to write to try { // Open the File using the Context this.os = openFileOutput(this.fileName, cxt);