Zaitsev Ilya
Zaitsev Ilya

Reputation: 1

Create object of the activity class

I tried to gete callback from the created activity using Invoke intent through NDK and get the result

But i have some problems.

I create a new activity using "startActivityForResult" method. So, object of this class creating in the start activity moment, and I can't get this object (for example, to call some methods).

I tried to create a new object without "starting" activity using:

WCHAR_T* className = 0;
convToShortWchar(&className, L"myPackage.myActivity");
jclass ccloc = helper->FindClass(className);
jmethodID activityInit = env->GetMethodID(ccloc, "<init>", "()V");
jobject activityObj = env->NewObject(ccloc, activityInit);

Program is crashed at the last line. activityInit and ccloc is not NULL.

myPackage.myActivity in the Java code is:

public class myActivity extends AppCompatActivity implements PaymentControllerListener{
...
}

There are exists onCreate method, constructor is not overidden.

Please, help, how can i take my Activity object to start a new activity with intent and take its result?

Upvotes: 0

Views: 64

Answers (0)

Related Questions