Title: Problem with ui/frame on getFragmentCallbacks · Issue #4901 · NativeScript/NativeScript · GitHub
Open Graph Title: Problem with ui/frame on getFragmentCallbacks · Issue #4901 · NativeScript/NativeScript
X Title: Problem with ui/frame on getFragmentCallbacks · Issue #4901 · NativeScript/NativeScript
Description: 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 [...
Open Graph Description: 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 veri...
X Description: 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 veri...
Opengraph URL: https://github.com/NativeScript/NativeScript/issues/4901
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Problem with ui/frame on getFragmentCallbacks","articleBody":"## Please, provide the details below:\r\nApplication crashes when navigating back on several views really fast and with the activityBackPressedEvent cancelling the back button on first view.\r\n\r\n### Did you verify this is a real problem by searching [Stack Overflow]\r\nYes, I've searched and couldn't find anything.\r\n\r\n### Tell us about the problem\r\nI've created an app with some views and I need to block the back button ONLY on the first view with the activityBackPressedEvent.\r\nBasically I've done this on the navigatedTo function of the first view:\r\n```\r\nmainPage = args.object;\r\nif(app.android) {\r\n app.android.on(app.AndroidApplication.activityBackPressedEvent, backEvent);\r\n}\r\n\r\n```\r\nAnd on the backEvent function I've put:\r\n```\r\nfunction backEvent(args) {\r\n var currentPage = frameModule.topmost().currentPage;\r\n if(mainPage == currentPage)\r\n args.cancel = true;\r\n}\r\n```\r\n\r\nBasically 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:\r\n\r\n\r\n### Which platform(s) does your issue occur on?\r\nAndroid\r\n\r\n### Please provide the following version numbers that your issue occurs with:\r\n- CLI: 3.2.1\r\n- Cross-platform modules: ~3.2.0\r\n- Runtime(s): 3.2.0\r\n\r\n### Please tell us how to recreate the issue in as much detail as possible.\r\nCreate some views and the navigation between them like View 1 --\u003e View 2 --\u003e View 3 --\u003e View 4 --\u003e 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.\r\n\r\n### Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.\r\nAlready on the description of the problem.\r\n","author":{"url":"https://github.com/pedromareis","@type":"Person","name":"pedromareis"},"datePublished":"2017-09-28T11:41:15.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":15},"url":"https://github.com/4901/NativeScript/issues/4901"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8689eff1-e867-400c-889a-908b53e7d942 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ECA6:635C3:13E5624:1B12129:6972A810 |
| html-safe-nonce | 372aa8db129299e926a96eebf58565e3b10a53d8a157a305b52e7e9e24080147 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQ0E2OjYzNUMzOjEzRTU2MjQ6MUIxMjEyOTo2OTcyQTgxMCIsInZpc2l0b3JfaWQiOiI1OTA3NzIxMjk4MzA0NDc3MjAwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | fb1ab5e7fd4633333ecbd3d93e82a708dd14ce485eed0c1e30970dc8388b703d |
| hovercard-subject-tag | issue:261288090 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NativeScript/NativeScript/4901/issue_layout |
| twitter:image | https://opengraph.githubassets.com/386afa9525cc75fe1edd1b8e4dc0d7a8128bf3bcf788cee9570eee73a46f611f/NativeScript/NativeScript/issues/4901 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/386afa9525cc75fe1edd1b8e4dc0d7a8128bf3bcf788cee9570eee73a46f611f/NativeScript/NativeScript/issues/4901 |
| og:image:alt | 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 veri... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | pedromareis |
| hostname | github.com |
| expected-hostname | github.com |
| None | ae357919e9cc5fb635a01c9a2cc530478d3ac85f55090215eb70e1beca3385ac |
| turbo-cache-control | no-preview |
| go-import | github.com/NativeScript/NativeScript git https://github.com/NativeScript/NativeScript.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 31492490 |
| octolytics-dimension-repository_nwo | NativeScript/NativeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31492490 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/NativeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 625f1bd9f76a617a9c0729e2de91edb56b6ce42f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width