I am making an application that takes data from a database and outputs
it on the screen in various ways, one of the ways is that i need to
take from a long list of strings, and put them into a homemade list,
ie:
TextView[] teamNumbers;
TextView[] teamNames;
TextView[] teamFavorites;
RelativeLayout rellayout =
(RelativeLayout)findViewById(R.id.rellayout);
String[] arrayOfItems = {"Number|Name|Favorite","Number|Name|
Favorite","Number|Name|Favorite"};
for(int x = 1; x < arrayOfItems.length; x++){
String[] teamData = arrayOfItems[x].split("|"); //[0]:Number $
[1]:Name $ [2]:Favorite
teamNumbers[x] = new TextView(getApplicationContext()); //Error |
Error | Error | Error | Error
teamNumbers[x].setText(teamData[0]);
rellayout.addView(teamNumbers[x];
}
So it will take an array, split it and then give me a list of results,
however, in creating of the layout, i am getting an error when
creating a new TextView in an array.
I need to be able to set up a list so that on click it will start and
intent passing it a single variable. If anyone has a simpler way fo
doing that, or a solution as to how to make this work, it would be
greatly appreciated. Thanks.
~Matt
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en