Skip to content

Problem with ui/frame on getFragmentCallbacks #4901

Description

@pedromareis

Please, provide the details below:

Application crashes when navigating back on several views really fast and with the activityBackPressedEvent cancelling the back button on first view.

Did you verify this is a real problem by searching [Stack Overflow]

Yes, I've searched and couldn't find anything.

Tell us about the problem

I've created an app with some views and I need to block the back button ONLY on the first view with the activityBackPressedEvent.
Basically I've done this on the navigatedTo function of the first view:

mainPage = args.object;
if(app.android) {
      app.android.on(app.AndroidApplication.activityBackPressedEvent, backEvent);
}

And on the backEvent function I've put:

function backEvent(args) {
    var currentPage = frameModule.topmost().currentPage;
    if(mainPage == currentPage)
        args.cancel = true;
}

Basically it works as expected except when I'm on view 5 and click several times on the back button, that's when the app crashes:
22091571_1647154951996162_1123662885_n

Which platform(s) does your issue occur on?

Android

Please provide the following version numbers that your issue occurs with:

  • CLI: 3.2.1
  • Cross-platform modules: ~3.2.0
  • Runtime(s): 3.2.0

Please tell us how to recreate the issue in as much detail as possible.

Create some views and the navigation between them like View 1 --> View 2 --> View 3 --> View 4 --> View 5 and click on the back button really fast a lot of times. Also, insert the code I've put on the description of my problem in the code of first view.

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

Already on the description of the problem.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions