0

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?

  • Crashed in what way? Have you tried using a debugger or at least looked at the log output? – Alan Birtles Apr 16 '23 at 14:05
  • idk how to tune visual studio to debug dynamic library. There are some problems with debugging: library is started by 1C Enterprise, so, i can't to manage that process. And i dont understand how it is working... – Zaitsev Ilya Apr 16 '23 at 14:21
  • What does `helper->FindClass` do ? – Botje Apr 17 '23 at 07:40
  • Also, why are you creating activities by hand? Is that even documented to work? – Botje Apr 17 '23 at 07:42

0 Answers0