Installed the new version of Lightning Launcher yesterday.
Installed the new version of Lightning Launcher yesterday.
I use a lot of scripting and it seems to crash now.
Previously, I used the method “LL.getAllDesktops()” and it worked fine. Now, LL crashes when I try to access the result of this function. I tried to use “getConfiguration().getAllDesktops()” instead since I saw that LL was deprecated, but LL keeps crashing.
Can someone please help me ?
Here is a preview of my code:
var dTab=getConfiguration().getAllDesktops();
var i=0,myCurrentDesktop=”default”;
myCurrentDesktop = getVariables().getString(“myCurrentDesktop”);
alert(myCurrentDesktop); // the correct value is displayed when I run the script
alert(dTab.getLength().toString()); // LL crashes without displaying this value. It crashes also if this line is removed
for(i=0;i { var id=dTab.getAt(i) ; if(getContainerById(id).getName() == myCurrentDesktop) { getHomeScreen().goToDesktop(id); return; } } getHomeScreen().goToDesktop(getConfiguration().getHomeDesktopId());
First, make sure that you are running 14.0.1, not 14. I published a bug fix update yesterday. It contains a ix linked with error reporting that may well be responsible for the crash.
Then replace getLength() with length (there is no getLength function on javascript arrays, only the length attribute). You can also safely remove toString.
Thanks for the quick reply!
Indeed downloading the latest version and replacing the getLength() by length did the trick 🙂
Here is the corrected script for reference:
var dTab=getConfiguration().getAllDesktops();
var i=0,myCurrentDesktop=”default”;
myCurrentDesktop = getVariables().getString(“myCurrentDesktop”);
//alert(myCurrentDesktop);
for(i=0;i
{
var id=dTab[i] ;
// alert(id) ;
if(getHomeScreen().getContainerById(id).getName() == myCurrentDesktop)
{
//alert(“found desktop to go to !”);
getHomeScreen().goToDesktop(id);
return;
}
}
getHomeScreen().goToDesktop(getConfiguration().getHomeDesktopId());
PS: I also gave a 5 stars rating to the app in Google Play: thanks for the great work and for the support!
Thanks 🙂