The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.
SDL
Simple Directmedia Layer Forums
SDL2, Android
link96
Joined: 25 Jan 2015
Posts: 1
Posted: Tue Jan 27, 2015 4:00 am
Maybe a stupid question, but:
I create SDLActivity instance in another activity, everything works fine.
SDLIntent = new Intent (this, SDLActivity.class);
and later
startActivity(SDLIntent);
However, if I pass some values via JNI function immediatly after startActivity it crashes, probably because the code in main() isn't yet up and running? If I pass them a little bit later, everything is OK.
How do I know when everything (I mean my main() native body) is fired up and running?
SiPlus
Joined: 06 Feb 2015
Posts: 13
Posted: Sat Feb 07, 2015 3:22 pm
You need to extend SDLActivity and call your functions inside it, or even within your native library itself.