Skip to content

Frame navigate, while android Activity is paused, crash #1389

Closed

Description

@mike-ense
Prio* Doing frameModule.topmost().navigate() when the app is not in the foreground crashes Java

The following page-1.js will crash Nativescript if you press the phone's "home" button as to switch activity away from the program within 5 seconds.

How can this be worked around?

var timerModule = require("timer");

exports.loaded = function(args) {
timerModule.setTimeout(function () {
frameModule.topmost().navigate({ create: function () {
return new pageModule.Page();
}});
},5000);
};

Activity

  1. NathanaelA commented on Jan 18, 2016

    @NathanaelA
  2. mike-ense commented on Jan 18, 2016

    @mike-ense
    Author

    @NathanaelA , aha beautiful workaround - would you mind pasting code snippet for how to listen for that properly ?

    E.g. just in the style listenforpause(function() { ... }); listenforresume(function() { .... }); , thanks

  3. NathanaelA commented on Jan 20, 2016

    @NathanaelA
  4. mike-ense commented on Jan 20, 2016

    @mike-ense
    Author

    @NathanaelA , is this watertight in your experience, no cornercases where it could crash or malfunction? Looks good!

  5. NathanaelA commented on Jan 20, 2016

    @NathanaelA
  6. mike-ense commented on Jan 20, 2016

    @mike-ense
    Author

    @NathanaelA , maybe that is a good reason to ask the Telerik guys to implement an actually solid solution to this problem? I mean, switching between pages is about as fundamental as a function can be come within {N}, so it's important that that Really Works - in particular when a crash means weird scary message to user PLUS shutdown of the app! (Even a 0.1% chance of your workaround above failing and instead leading to a crash, is unacceptable here.) What do you think?

  7. mike-ense commented on Jan 20, 2016

    @mike-ense
    Author

    @vakrilov what do you say? I.e. Nathanael suggested a way to mitigate frameModule.topmost().navigate() 's crash potential, but we're not sure his workaround is 100% solid - what about you have a look at this and provide some way that is guaranteed to always work as in safeguard {N} app from hard Java VM + app crashes in relation with frameModule.topmost().navigate() ? Thanks :)

  8. added this to the milestone on Jan 22, 2016
  9. self-assigned this
    on Feb 8, 2016
  10. modified the milestones: 1.7.0, on Feb 24, 2016
  11. added
    ready for testTSC needs to test this and confirm against live production apps and automated test suites
    and removed on Feb 25, 2016
  12. changed the title [-]Prio* Doing frameModule.topmost().navigate() when the app is not in the foreground crashes Java[/-] [+]Frame.navigate while android activity is paused crashes[/+] on Feb 25, 2016
  13. changed the title [-]Frame.navigate while android activity is paused crashes[/-] [+]Frame.navigate while android Activity is paused crashes[/+] on Feb 25, 2016
  14. changed the title [-]Frame.navigate while android Activity is paused crashes[/-] [+]Frame.navigate while android Activity is paused crash[/+] on Feb 25, 2016
  15. changed the title [-]Frame.navigate while android Activity is paused crash[/-] [+]Frame.navigate, while android Activity is paused, crash[/+] on Feb 25, 2016
  16. changed the title [-]Frame.navigate, while android Activity is paused, crash[/-] [+]Frame navigate, while android Activity is paused, crash[/+] on Feb 25, 2016
  17. added and removed
    ready for testTSC needs to test this and confirm against live production apps and automated test suites
    on Mar 14, 2016
  18. lock commented on Aug 30, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  19. locked and limited conversation to collaborators on Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions