Android - 如何通过 PApplet 获取 activity

Android - How to get an activity by a PApplet

我有两个 类,一个从 PApplet 延伸,另一个从 Activity 延伸。 我不会通过 Intent 相互交流。我该怎么做?

示例:

//Class that extends PApplet.
Intent intent = new Intent(this, Test.class); //Activity I wanna go to.
startActivity(intent);
    Intent intent = new Intent(this.getActivity(), Teste.class);
    try {
        this.finalize();
    } catch (Throwable throwable) {
        throwable.printStackTrace();
    }
    this.startActivity(intent);