title: using openFileOutput() in a class. (not an activity)
body: <p>my Activity class calls to another non-activity class and when i try to use openFileOutput, my IDE tells me that openFileOutput is undefined. please help:</p>
  
  <pre><code>import java.io.File;
  import java.io.FileInputStream;
  import java.io.FileOutputStream;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.OutputStream;
  import java.io.*;
  
  import android.util.Log;
  import android.content.Context;
  
  public class testFile(){
  
  Context fileContext;
  
  public testFile(Context fileContext){
      this.fileContext = fileContext;
  }
  
  public void writeFile(){
      try{
              FileOutputStream os = fileContext.getApplicationContext().openFileOutput(fileLoc, Context.MODE_PRIVATE);
          os.write(inventoryHeap.getBytes()); // writes the bytes
          os.close();
          System.out.println("Created file\n");
      }catch(IOException e){
          System.out.print("Write Exception\n");
      }
  }
  }
  </code></pre>