December 30th, 2011, 04:54 PM
|
#2 (permalink)
|
|
Premium Member
Join Date: Oct 2011
Location: Sydney, Australia
Posts: 193
Device(s): Galaxy Nexus GSM
Thanks: 2
Thanked 37 Times in 33 Posts
|
Quote:
Originally Posted by ondrovic
First if I have this setup and want to only do something if debug is set to true how do I do it?
Code:
<bool name="debug">false</bool>
|
Use the Java XML API in javax.xml.* to read in the file and use a XPath query to find the value of the bool node whose name attribute is debug. This would be an expensive operation, so only do it once and then cache the result.
Quote:
Originally Posted by ondrovic
Second I want to setup a multidimensional array using a spinner that holds details and price per selection
example:
Code:
Name="Name of feature"
Price="Price of feature"
|
I'll assume you've, at the very least, already gone through the Hello, Spinner tutorial.
You want some kind of SpinnerAdapter. You could implement one yourself directly by subclassing BaseAdapter. Alternatively transform your data so you can use one of the provided subclasses of BaseAdapter, such as ArrayAdapter.
(Ahh, looks like you'd already figured that out.)
|
|
|
Last edited by jiminaus; December 30th, 2011 at 04:56 PM.
|
|