I’m a newbie in Android Development and I want to implement Spinner. My problem is that I have an array which has 9 values for a key Category. My array looks like:
MyArray
[{Category=Things To Do},
{Category=Transportation},
{Category=Food and Drink},
{Category=Accommodation},
{Category=Shopping},
{Category=Money and Costs},
{Category=Business},
{Category=Turkey Tour},
{Category=Events}]
I want to get value of category key. i need MyArray for spinner as bellow:
MyArray
{
Things To Do
Transportation
Food and Drink
Accommodation
Shopping
......
}
It is similar to iPhone code.
// iPhone code
for(int i=0; i<[arrayCategory count]; i++)
{
NSString *strSubTitle=[[arrayCategory objectAtIndex:i]objectForKey:@"category"];
}
Any idea?
Please help me.
Thanks
first create a xml in string for your String array
then use the above xml for string array in your code like below