title: How to fix Cannot resolve method 'openFileOutput(java.lang.String, int)'
body: <p>The error keeps coming even if I remove the context or add it</p>
  
  <pre><code>public class fileHelper {
      public static final String FILENAME = "listinfo.dat";
      public static void writeData(ArrayList&lt;String&gt; items, View.OnClickListener context){
          try {
              FileOutputStream fos = context.openFileOutput(FILENAME, Context.MODE_PRIVATE);
              ObjectOutputStream oos = new ObjectOutputStream(fos);
              oos.writeObject(items);
              oos.close();
          } catch (FileNotFoundException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
  </code></pre>
  
  <p>I have already tried removing the context</p>