Can LC display a list in a picker view, in Android?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Can LC display a list in a picker view, in Android?

Post by DR White » Thu Aug 27, 2015 1:18 pm

Can LC display a list in a picker view, in Android?

How?

Thanks,

David

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Can LC display a list in a picker view, in Android?

Post by jacque » Thu Aug 27, 2015 6:52 pm

Sure. See "mobilePick" in the dictionary.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: Can LC display a list in a picker view, in Android?

Post by DR White » Thu Aug 27, 2015 8:05 pm

Jacque,

I have spent a couple hours trying to use the information on that topic, but I have not found enough information to create a moblePick using a field, that will work on an Android.

Please refer me to an additional resource or show me an example.

Thanks,

David

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Can LC display a list in a picker view, in Android?

Post by jacque » Thu Aug 27, 2015 8:33 pm

Given a field that contains this:

cow
horse
dog
cat

You can use this handler:

Code: Select all

on mouseUp
  mobilePick fld 1,0
  answer "result = " && the result
end mouseUp
The answer dialog will return the line number that was chosen. This is the simplest example, you can also add Cancel or Done buttons.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: Can LC display a list in a picker view, in Android?

Post by DR White » Fri Aug 28, 2015 5:58 pm

Jacque,

That works Good!

Is there a way to control the the Height and Width of the picker?

Thanks,

David

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Can LC display a list in a picker view, in Android?

Post by jacque » Sat Aug 29, 2015 3:06 am

The appearance of the picker is controlled by the OS, so you get the same standardized size that all apps use.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply