@TheCodez I’m not entirely sure, but something like the following.
static instance field of your activity call it
sActivity and initialize it with
this in your
In C++ use something like this
JNIEnv* env = JniHelper::getEnv();
jclass activityClass = env->FindClass("com/example/YourActivityName");
//Get the Activity field
jfieldID activityField = env->GetStaticFieldID(activityClass, "sActivity","Lcom/example/YourActivityName;");
//Get the Activity object
jobject activityObject = env->GetStaticObjectField(activityClass, activityField);
Note: I wrote this code without a IDE, so it might not work nor will it compile successfully. Hope its a good starting point anyways.