I’ve created this function to simplify creating such lists.

I’ve created this function to simplify creating such lists.

Feel free to use it 😉

I use it already in MultiTool (picture) and AutoFormat scripts. It works fine for me.

And it’s scrollable.

]]>

6 Commentsto I’ve created this function to simplify creating such lists.

  1. Anonymous says:

    < ![CDATA[

    //Initialize List


    //import java classes


    LL.bindClass(“android.app.AlertDialog”);


    LL.bindClass(“android.content.DialogInterface”);



    //function to display a List in a Popup, where the user can select one item


    list=function(items,listener,title)


    {


    var builder=new AlertDialog.Builder(LL.getContext());


    builder.setItems(items,listener);


    builder.setCancelable(true);


    builder.setTitle(title);


    builder.setNegativeButton(“Cancel”,new DialogInterface.OnClickListener(){onClick:function(dialog,id){dialog.cancel();}});//it has a Cancel Button


    builder.create().show();


    }

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Lukas Morawietz, did you know all those android classes from before? I tried to learn how to do those things…but it’s too different from what I’m used to.


    Can you point me to something where to learn to use those class?



    Just..wow

    ]]>

  3. Anonymous says:

    < ![CDATA[

    Nope, I didn’t knew anything before the update 10.5. I just used three Websites:


    http://developer.android.com/reference



    http://stackoverflow.com



    http://google.de 



    And I used a lot of trial’n’error

    ]]>

  4. Anonymous says:

    < ![CDATA[

    Well nothing is a bit too hard… I was used to Java before, but the only thing I did with was programming my NXT Mindstorms 😉

    ]]>

  5. Anonymous says:

    < ![CDATA[

    Lukas Morawietz I have some improvements ideas for your function, I’ll post later today or tomorrow



    Lego NXT? 😉 version 1, 2 or 3 ? (the third is under linux!!) 

    ]]>

  6. Anonymous says:

    < ![CDATA[

    I think it’s the first version

    ]]>

Leave a Reply

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