Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AllegroActivity::onResume() isn't called. #4

Open
YongJin-Cho opened this issue Apr 1, 2020 · 1 comment
Open

AllegroActivity::onResume() isn't called. #4

YongJin-Cho opened this issue Apr 1, 2020 · 1 comment

Comments

@YongJin-Cho
Copy link

When pausing and resuming, logcat doesn't give "onResume".
And app crashed because of no responding.

@YongJin-Cho
Copy link
Author

after resuming, touch input doesn't work and makes crash. the below is the code.

#include <allegro5/allegro5.h>

int main(int argc, char **argv) {
al_init();
al_install_touch_input();

auto display = al_create_display(0, 0);
auto queue = al_create_event_queue();
auto timer = al_create_timer(1 / 60.0);
auto redraw = true;
al_register_event_source(queue, al_get_display_event_source(display));
al_register_event_source(queue, al_get_timer_event_source(timer));
al_start_timer(timer);

al_register_event_source(queue, al_get_touch_input_event_source());

ALLEGRO_DEBUG_CHANNEL("app");

while (true) {
    if (redraw) {
        al_clear_to_color(al_map_rgb_f(1, al_get_time() - (int)(al_get_time()), 0));
        al_flip_display();
        redraw = false;
    }
    ALLEGRO_EVENT event;
    al_wait_for_event(queue, &event);
    if (event.type == ALLEGRO_EVENT_TIMER) {
        redraw = true;
    }
    else {
        redraw = true;
        ALLEGRO_DEBUG("event: %d\n", event.type);
    }
}
return 0;

}

the below is log.
2020-04-03 03:15:06.475 26350-26399/com.allegro.test1 I/allegro: app D 26399: native-lib.cpp:36 main [ 20.34395] event: 52
2020-04-03 03:15:06.546 26350-26399/com.allegro.test1 I/allegro: app D 26399: native-lib.cpp:36 main [ 20.41416] event: 52
2020-04-03 03:15:06.613 26350-26399/com.allegro.test1 I/allegro: app D 26399: native-lib.cpp:36 main [ 20.48187] event: 51
2020-04-03 03:15:07.722 26350-26350/com.allegro.test1 D/AllegroActivity: onPause
2020-04-03 03:15:07.727 26350-26350/com.allegro.test1 I/allegro: android D 26350: android_system.c:286 Java_org_liballeg_android_AllegroActivity_nativeOnPause [ 21.59519] pause activity
2020-04-03 03:15:07.727 26350-26350/com.allegro.test1 D/AllegroActivity: onPause end
2020-04-03 03:15:08.335 26350-26350/com.allegro.test1 D/AllegroSurface: surfaceDestroyed
2020-04-03 03:15:08.345 26350-26350/com.allegro.test1 I/allegro: display D 26350: android_display.c:69 Java_org_liballeg_android_AllegroSurface_nativeOnDestroy [ 22.21396] AllegroSurface_nativeOnDestroy
2020-04-03 03:15:08.345 26350-26350/com.allegro.test1 I/allegro: display D 26350: android_display.c:84 Java_org_liballeg_android_AllegroSurface_nativeOnDestroy [ 22.21400] locking display event source: 0xd8285280 0xd8285280
2020-04-03 03:15:08.345 26350-26350/com.allegro.test1 I/allegro: display D 26350: android_display.c:95 Java_org_liballeg_android_AllegroSurface_nativeOnDestroy [ 22.21404] unlocking display event source
2020-04-03 03:15:09.746 26350-26399/com.allegro.test1 I/allegro: app D 26399: native-lib.cpp:36 main [ 23.61498] event: 46
2020-04-03 03:15:10.400 26350-26399/com.allegro.test1 I/allegro: app D 26399: native-lib.cpp:36 main [ 24.26899] event: 48
2020-04-03 03:15:23.258 26350-26379/com.allegro.test1 I/d.bangtal.test: Thread[2,tid=26379,WaitingInMainSignalCatcherLoop,Thread*=0xd8200000,peer=0x12d42398,"Signal Catcher"]: reacting to signal 3
2020-04-03 03:15:23.334 26350-26379/com.allegro.test1 I/d.bangtal.test: Wrote stack traces to tombstoned

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant