Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Exiting the main method "freeze" the Android application  (Read 2035 times)

0 Members and 1 Guest are viewing this topic.

Misopeth

  • Newbie
  • *
  • Posts: 6
    • View Profile
Exiting the main method "freeze" the Android application
« on: September 15, 2015, 10:22:03 pm »
I'm trying to use SFML to implement a NativeActivity in a larger project.
First a non-native activity is started, after a while this activity start the SFML NativeActivity and when the user press the "back" button (that trigger a sf::Event::KeyPressed with event.key.code == sf::Keyboard::Escape, as sf::Event::Closed doesn't seem to ever be triggered) the NativeActivity closes and the non-native activity should take back the control, but instead it is "freezed" (non-responding).

I copied Android.mk, Application.mk, main.cpp and the needed part of AndroidManifest.xml from the android example.
I'm using SFML 2.3.2.

Am I missing something in the app or window lifecycle?

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Exiting the main method "freeze" the Android application
« Reply #1 on: September 15, 2015, 10:49:49 pm »
Does it work, if you skip the Java activity? I suspect you're triggering some undefined/unexpected behavior.

Misopeth

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Exiting the main method "freeze" the Android application
« Reply #2 on: September 15, 2015, 10:52:52 pm »
It works, but only because when the NativeActivity stops the entire application is closed, so there's nothing that could go wrong.

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Exiting the main method "freeze" the Android application
« Reply #3 on: September 15, 2015, 11:05:55 pm »
Would be nice if you could try to track this down or provide a minimal example doing what's causing your issues. I only have minimal experience with writing Java apps, so not that proficient with that.

Misopeth

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Exiting the main method "freeze" the Android application
« Reply #4 on: September 15, 2015, 11:58:27 pm »
I'm pretty new to C/C++ programming, so I don't really know how to track down the problem.
« Last Edit: January 14, 2016, 04:19:51 pm by Misopeth »

maxwell79

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: Exiting the main method "freeze" the Android application
« Reply #5 on: October 16, 2015, 01:38:53 am »
I also am encountering this on Android 4.4.2.