Below is a snippet of my subclass crawlerSub in MainActivity class:

> 
> class crawlerSub extends AsyncTask {
>  private int count = 0;
> 
> 
> 
> ```
> @Override
> protected Void doInBackground(Void... params) {
>     try {
>         Crawler.crawler("http://www.ipmart.com.my", 10);
> 
>     } catch (IOException e) {
>         e.printStackTrace();
>     }
>     return null;
> }
> 
> @Override
> protected void onPostExecute(Void aVoid) {
>     File file = null;
>     FileOutputStream fos = null;
>     try {
>         file = this.getFilesDir();
>         fos = this.openFileOutput("visitedLinks", Context.MODE_PRIVATE);
>         for (String link : Crawler.visitedLinks) {
>             fos.write(link.getBytes());
>         }
>     } catch (FileNotFoundException e) {
>         Log.d("Log", e.toString());
>     } catch (IOException e) {
>         Log.d("Log", e.toString());
>     } finally {
>         try {
>             fos.close();
>         } catch (IOException e) {
>             Log.d("Log", e.toString());
>         }
>     }
>     Toast.makeText(ctx, "File saved to " + file, Toast.LENGTH_SHORT).show()
> } }
> 
> ```
> 
> 

My question lies in these 2 lines of code:

> 
> file = this.getFilesDir();
>  fos = this.openFileOutput("visitedLinks", Context.MODE\_PRIVATE);
> 
> 
> 

when I use "this.getFilesDir()" it gives me "Cannot resolve method error"
How can I solve this? Thanks.