Skip to main content
Inspiring
April 20, 2015
Question

Accessing from ANE to Android Main Activity

  • April 20, 2015
  • 1 reply
  • 1148 views

Hi,

I'm building an ANE to access to a third party library.

If I would like to add the SDK to native code, I could do two things

1) Change MainActivity, let it implement an interface and implement some methods.

2) In the MainActivity, write code on "onCreate()", "onStart()", "onStop()", "onNewIntent(Intent)", "onResume()" methods

Basically, I would like to ask if there is any way access to main activity and and reimplement those methods. Or inject behaviour somehow.

Thanks!

This topic has been closed for replies.

1 reply

Inspiring
April 22, 2015

Solution found. Thanks to Vrvy.

[Android] Getting onActivityResult and onStart/onPause/.... events from AIR activity [solution]

I don't really know why Adobe does not have this solution added to their docs (or at least something similar!!) . Implement MainActivity behaviour is a must-need-for-sure during ANE development in Android. AndroidActivityWrapper class seems to be a "magical class which will solve are your problems" and I wasn't able to find any docs about that.

Oldes
Inspiring
March 5, 2018

AndroidActivityWrapper does not provide onNewIntent which I need. Any idea?