2

I was trying to do @Override with JNI (so during runtime). This is a sample of how the override is completed in non-JNI:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    // do my custom stuff here
    super.onActivityResult(requestCode, resultCode, data); // call regular
}
Farhad
  • 12,178
  • 5
  • 32
  • 60
Noitidart
  • 35,443
  • 37
  • 154
  • 323
  • 1
    It is not clear what you are asking. – JJF Feb 16 '16 at 20:30
  • Thanks @JJF for your attention. I know how to call methods with JNI but I don't know how to "Create the onActivityResult" listener from JNI. It seems everyone is setting up this `@Override` prior to runtime. Because JNI is executed during runtime, I am trying to find a way to do an override during runtime, does this help make it more clear? – Noitidart Feb 16 '16 at 21:23
  • 2
    See http://stackoverflow.com/questions/16928459/how-to-call-an-a-overridden-super-class-method-in-java-through-jni – Michael Feb 17 '16 at 09:05
  • Thanks @Michael that calls the overridden, however I'm trying to override. Calling the super will be my second step. – Noitidart Feb 17 '16 at 09:33
  • 3
    The question I linked to also shows how to do a native override, which is why I linked to it. Declare your method `@Override protected native void onActivityResult(blah blah);` and then write the native implementation in your C or C++ code. – Michael Feb 17 '16 at 09:35
  • Ah thanks very much I will re-read and update you. – Noitidart Feb 17 '16 at 09:39

0 Answers0