-
-
Notifications
You must be signed in to change notification settings - Fork 244
solution of application resume problem #78
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
Comments
This problem is born from [process lifetime and activity lifetime is different]. |
Where should I add this code? |
it is wrote for dev, so it's complex to guide for using. [WARN : text below this line wrote not English language for easy communication.(about how to use)] 저 내용은 index.js에 들어가야 합니다. Vue.$start({
data() {
let obj = {
//WHAT YOU WANT
};
//WHAT YOU WANT
return obj;
},
created() {
//WHAT YOU WANT
},
template: `<router-page></router-page>`
}, function() {
let routes =[
{path: '*', redirect: '/' + page}
//WHAT YOU WANT
];
const router = new VueRouter({
routes: routes
});
router.replace({name: "START_PAGE_NAME"});
return router;
}); 저는 더 다른 형태로 사용하기 때문에 축약하면 위와 같습니다. |
한국인이신가요? Is it related to the above code and reopen error? |
the code described above is solution for reopen error. 네. |
Vue$3는 app 내 nativescript-vue 안에 있는 index.js에 있는 코드를 대체해야 하는겁니다. |
1 similar comment
Vue$3는 app 내 nativescript-vue 안에 있는 index.js에 있는 코드를 대체해야 하는겁니다. |
As you know, if you do not use process kill, resume your application make [View already has parent error].
I guess root of this problem is alive time of application view and vue instance.
[Process Started] -> AppView Dead / VueInstance Dead
[App Started] -> AppView Alive / VueInstance Alive
[App Destroyed] -> AppView Dead / VueInstance Alive
[App Started] -> AppView Alive / VueInstance Alive
[App Destroyed] -> AppView Dead / VueInstance Alive
[Process Closed] -> AppView Dead / VueInstance Dead
When you re-start app, your vue instance is alive inside of application.start({ create(){HERE} });
So self.$el.nativeView will return View that should be dead at destroyed time but alived due to VueInstance reference.
Here is my simple boiler plate patch.
It add main_vm and clear it at application.on(exitEvent).
So your vue instance will replaced with another root vue instance.
NOW YOU CAN USE android.app.Service.extend FOR CREATING BACKGROUND SERVICE
OLD WAY TO CLEAN nativescript-vue - PROCESS KILL, IS KILL SERVICE TOO
The text was updated successfully, but these errors were encountered: