Test script of Customview.
Test script of Customview.
It’s only show toast once.
Android.makeNewToast(“test”,true).show();
return;
Next script is ‘re-create’ Customview.
Run in foreground, show toast once.
LL.getItemById(customview’s item id).getProperties().edit().setString(“v.onCreate”,customview’s script id).commit();
But, Run ‘re-create’ script in background(using Tasker), after then, every time creating Customview, show toast twice.
So, It’s means that it’s creating Customview twice.
And when open LL’s desktop settings, toast will also be shown. It’s means that ‘re-create’ Customviews.
I’m in trouble because of this…
]]>« Does anyone uses the termux widget? (Previous Post)
< ![CDATA[
With V14 views are created once per screen. Previously views were created once for the app.
So what happen here is that when the custom view is modified, it is rebuilt once in the home screen (probably) and once in the background screen. If the custom view is present on the floating screen, it may be rebuilt here.
In theory this shouldn’t be a problem.
If you have some exclusive resource, or a single initialization to do, you may check the screen for which the view is created this way:
if(item.getScreen()==”HOME”) {
do something, it will be executed only once
} else {
do something else
}
]]>