Skip to content

[Android] View._onDetached called twice when app is suspended. #1543

Closed

Description

@x4080

Hi, I wondered if this is intended? To reproduce :

  • just add listview with content
  • I add console.log in listview-android
    public _onDetached(force?: boolean) {
  console.log('detached');
}

and when we click back button on android (to go to home screen), it will called twice. I dont know about iOS since going to home screen seems not doing suspending/ quitting

btw using back button in android seems still retain all the previous values in the javascript ? So the activity is not recreated (at least the javascript) ?

Activity

  1. hamorphis commented on Feb 17, 2016

    @hamorphis
    Contributor

    We are aware of this. It is a private method though. What is the scenario that you are trying to achieve?

  2. self-assigned this
    on Feb 17, 2016
  3. x4080 commented on Feb 18, 2016

    @x4080
    Author

    I was creating custom component based on listview

  4. hamorphis commented on Feb 18, 2016

    @hamorphis
    Contributor

    @x4080 OK. I will see whether I can fix this in a neat way. Stay tuned.

  5. added this to the milestone on Feb 18, 2016
  6. x4080 commented on Feb 18, 2016

    @x4080
    Author

    cool

  7. hamorphis commented on Feb 19, 2016

    @hamorphis
    Contributor

    @x4080 I tried what you described and _onDetached was called once. I also tried navigating forward from a page that contains a ListView and it was also called only once. I can't reproduce this. Can you send me a small sample app that does exhibit this behavior. Thanks.

  8. x4080 commented on Feb 19, 2016

    @x4080
    Author

    What i did was exit the app with backspace. Sorry if im not describing it completely.

  9. changed the title [-]listview _onDetached called twice (android)[/-] [+][Android] View._onDetached called twice when app is suspended.[/+] on Feb 22, 2016
  10. added 2 commits that reference this issue on Feb 22, 2016
  11. modified the milestones: , 1.7.0 on Feb 24, 2016
  12. x4080 commented on Mar 19, 2016

    @x4080
    Author

    Hi, just wanted you guys to know that this problem still persists in 1.6 it will be fix in 1.7 ?

  13. 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.

  14. 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