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.
]]>« – sum up post (again) –
– Uploaded Export Scripts Script to the wiki (Previous Post)
(Next Post) Pierre Hébert I tried your Compass script. »
< ![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();
}
]]>
< ![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
]]>
< ![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
]]>
< ![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 😉
]]>
< ![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!!)
]]>
< ![CDATA[
I think it’s the first version
]]>