Awesome, this is awesome.

Awesome, this is awesome.

Pierre Hébert: do you remember one of my old suggestions about launch an app with the ‘clear flag’, I mean to launch it as new instead of open again as from the recent menu.

Well, just launch this from the shortcut:

var i=LL.getEvent().getItem();

var nt= i.getIntent();

i.setIntent(nt.clone().addFlags( Intent().FLAG_ACTIVITY_CLEAR_TASK ));

i.launch();

i.setIntent(nt);

Awesome, we have almost full power from Intents :DDD {perhaps it’s too much but what about LL.launchIntent(Intent intent); ?}

]]>

7 Commentsto Awesome, this is awesome.

  1. Anonymous says:

    < ![CDATA[

    What exactly does the clear task flag?

    ]]>

  2. Anonymous says:

    < ![CDATA[

    The same as kill the app and start it again (theoretically)


    With YouTube and Google play store it forces a load instead of resume where you leaved it.

    ]]>

  3. Anonymous says:

    < ![CDATA[

    More exactly it removes activities that have been launched after the root one. It is not removed from memory.


    Yes it is a lot of power, I was wondering whether it was safe or not, and finally came to the conclusion that since everyone is able to create a template with any intent if needed, there is no more risk to enable it through scripting.


    launchIntent would be startActivity because intents have more usages than just activities.

    ]]>

  4. Anonymous says:

    < ![CDATA[

    Is this a ‘yes’ or a ‘no’ or a ‘possibly’ for startActivity ?

    ]]>

  5. Anonymous says:

    < ![CDATA[

    This is a “possibly”

    ]]>

  6. Anonymous says:

    < ![CDATA[

    More exactly: I feel like there is more to do with this, so I would like to take the time to see whether there is a bigger API to put in a place here. For instance I should have done this for Script: instead of LL.setScriptTag/getScriptTag, I should have created the Script class with the methods setTag/getTag right at the beginning.

    ]]>

  7. Anonymous says:

    < ![CDATA[

    Seems legit. I would suggest to do that and set the get/setscripttag methods to deprecated. And then remove them later… Old scripts are anyway often buggy, for instance some of my old scripts throw a bad argument exception. So I think LL (and especially LL scripting) is a progress that should go on, even if some old stuff won’t work anymore…

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *