Skip to content

Bug when re-opening the android app with the app icon. #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tralves opened this issue Oct 9, 2017 · 4 comments
Closed

Bug when re-opening the android app with the app icon. #59

tralves opened this issue Oct 9, 2017 · 4 comments

Comments

@tralves
Copy link

tralves commented Oct 9, 2017

Steps to reproduce:

  1. If you open an app
  2. Close it with the Android back physical button
  3. Open it again through the app icon

Expected

The app opens normaly

Result

You get the error:

screen shot 2017-10-09 at 10 58 19

This error happened with both the Groceries Vue app and the ui-tests app.

@blackss2
Copy link

blackss2 commented Oct 18, 2017

I have same problem and you can fix that problem with this boiler plate way.

NativeScript/NativeScript#4960

finally i found root of this problem.
what you see is only occurred at Vue cuz it reuse page if not destroyed using below code.
this is first clue.

    if (!prevVnode) {
      // initial render
      vm.$el = vm.__patch__(
        vm.$el, vnode, hydrating, false /* removeOnly */,
        vm.$options._parentElm,
        vm.$options._refElm
      );
    } else {
      // updates
      vm.$el = vm.__patch__(prevVnode, vnode);
    }

other example application doesn't make this problem but application context is not saved.
this is second clue.

if you [start application using auto sync -> home button -> start using app button -> back button] will make second activity.
this is last clue.

my conclusion is that [debug(auto syncing) app] and [run by app icon] doesn't use same activity.
if you add some condtion to if(!prevVnode) -> if(!prevVnode || true), your problem is disappeared.
it means [app icon activity try to getting Page's view] that owned by [debug activity Page's view].
it make [view already has a parent] error.
so it is not nativescript-vue's problem.
it just development side problem that not occurred at released application.

@rigor789
Copy link
Member

Just for reference here is the Activity lifecycle diagram, I think we need to implement android specific behavior (hook into the lifecycle) to handle resumed activities: https://developer.android.com/guide/components/activities/activity-lifecycle.html#alc

@rigor789 rigor789 added this to the v1.0.0 milestone Nov 24, 2017
@rigor789 rigor789 mentioned this issue Nov 30, 2017
@seohangyu
Copy link

@blackss2
I tried with the release. But still bugs happen.

@blackss2
Copy link

blackss2 commented Dec 1, 2017

Try this
#78

@nativescript-vue nativescript-vue locked as resolved and limited conversation to collaborators May 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

4 participants