question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem with ui/frame on getFragmentCallbacks

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
hshristovcommented, Dec 15, 2017

@pedromareis This should be fixed in master branch and will be included in 3.4 If possible please try it with @next of tns-core-modules and ping me back if issue is still present.

1reaction
pedromareiscommented, Oct 2, 2017

@tsonevn well, from what I see in the gif I don’t think you’re doing it exactly like I did… The problem only occurs if you tap quickly on the back button and multiple times. Could you try that?

Basically I don’t even give the app time to process all the taps on the back button and the app eventually crashes because of that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript callback when IFRAME is finished loading?
First up, going by the function name xssRequest it sounds like you're trying cross site request - which if that's right, you're not...
Read more >
live() on ajax:callbacks does not work for iframes #171 - GitHub
Hello, I have an IFRAME into a page HTML. The iFRAME loads a page containing a FORM with :remote => true. Form is...
Read more >
Callback option for t.modal() opened from iframe - Trello
I have discovered an unexpected issue. It appears that in secondary iframes the callback for t.modal() (I noticed this for t.
Read more >
YouTube Player API Reference for iframe Embeds
The IFrame player API lets you embed a YouTube video player on your website and control the player using JavaScript. Using the API's...
Read more >
How to check a webpage is loaded inside an iframe or into the ...
An iFrame is a rectangular frame or region in the webpage to load or display another separate webpage or document inside it.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found