SelectFile library generates a “FATAL EXCEPTION: main” error

Hi Paul, It is a bit embarrassing but I cannot get the code run. So here is what I did. I combined the two code parts in a new sketch and added the Permission class. Made sure to allow reading and writing to the external storage. Dragged the filewriterv1.jar into the sketch. Checked that the jar is in the Lib directory.
The following errors were generated:

  1. The name “Files” cannot be recognized
  2. The function “FilterAll(String)” does not exist.
  3. The name "textFiles"cannot be recognized.
    It is obvious that I am missing something.
    Can you please put me on the right path.
    marc

here the complete code of the sketch
(I am only looking for txt files)

import android.content.Intent;

BMS b;
fileInput f;
void setup() {
  size(600, 600, P2D);
  b = new BMS(this);
  f = new fileInput(this);
  f.folder = true;
  f.file = true;
  //f.image = true;
};

void draw() {
  background(255);
  f.displayImage();
  f.readContents();
};

void mousePressed() {
  f.getItem();
};


//@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
  f.handleActivity(requestCode, resultCode, data);
};



public String[] listFiles(String s1) {
  String  []s = null;
  String path = s1;
  println("Files", "Path: " + path);
  File directory = new File(path);
  File[] files = directory.listFiles();
  if (files!=null) {
    s = new String [files.length];
    println("Files", "Size: "+ files.length);
    for (int i = 0; i < files.length; i++)
    {
      s[i] = files[i].getName();
      Files.add(s[i]);
      filterAll(s[i]);

      println("Files", "FileName: " + files[i].getName());
    }
  }
  //println("Images", images.size());
  println("text", textFiles.size());
  //println("Audio", audioFiles.size());
  //println("Other", otherFiles.size());
  return s;
};



public class Permission {

  PApplet parent;
  String p;

  public Permission(PApplet pParent, String permissionName) {
    parent = pParent;
    p = permissionName;
    parent.requestPermission("android.permission."+permissionName, "onPermissionResult", this);
  };

  public void onPermissionResult(boolean granted) {
    if (!granted) {
      PApplet.println("User did not grant", p, "permission.", p, "is disabled.");
    }
  };
};