07.01.2013 Views

David Defour - Université de Perpignan

David Defour - Université de Perpignan

David Defour - Université de Perpignan

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

JAVA<br />

(RELEVANT PARTS, CONTINUED)<br />

jeudi 26 janvier 12<br />

private List getFutureAndroidVendors() {<br />

String[] vendorArray = { "Apple", "RIM",<br />

"Palm", "Microsoft" };<br />

List vendorList = Arrays.asList(vendorArray);<br />

Collections.shuffle(vendorList);<br />

return(vendorList);<br />

} The last argument to the ArrayAdapter<br />

constructor on previous page can be any List<br />

or String[]. I am randomizing the or<strong>de</strong>r of the<br />

elements to <strong>de</strong>monstrate that you can have Java<br />

compute the entries instead of having a fixed set of<br />

choiuces (in which case you would <strong>de</strong>fine the entries<br />

in the XML file as with approach 1).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!