I've read a java tutorial explaining an "array of arrays" with something similar to coordinates. For instance,
mainArray [0] [0] = "arrayA";
mainArray [0] [1] = 1;
mainArray [0] [2] = 2;
mainArray [1] [0] = "arrayB";
mainArray [1] [1] = 1;
Is it plausable to populate a listview using this type of array in android (using the first set of numbers and not the subset)? I haven't had the chance to try it yet.
asked Sep 16, 2011 at 22:40
cerealspiller
1,4013 gold badges14 silver badges23 bronze badges
-
1you can see the following which is may help you. Stackoverflow existing problem and solution. Link1 and Link 2 Two dimesional array in java. Link1 and link 2Horrorgoogle– Horrorgoogle2011年09月16日 23:02:32 +00:00Commented Sep 16, 2011 at 23:02
2 Answers 2
Yes, it is possible.
You have to write a custom ListAdapter preferable extending ArrayAdapter.
Sign up to request clarification or add additional context in comments.
1 Comment
cerealspiller
Thanks, I'll keep looking through this code and studying it. Other custom array adapter codes I've seen are close to what im looking for but alot more difficult to understand without the notes.
A better option would be to define a "coordinates" object and then make an array or list of those objects. Then use that to populate your ListView.
answered Sep 16, 2011 at 22:48
Steve Bergamini
14.6k6 gold badges65 silver badges89 bronze badges
1 Comment
cerealspiller
Are you referring to the array of arrays? If not, I don't quite understand.
default