0

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
1
  • 1
    you 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 2 Commented Sep 16, 2011 at 23:02

2 Answers 2

1

Yes, it is possible.

You have to write a custom ListAdapter preferable extending ArrayAdapter.

Look at http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html

jenzz
7,2676 gold badges51 silver badges71 bronze badges
answered Sep 16, 2011 at 22:48
Sign up to request clarification or add additional context in comments.

1 Comment

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.
0

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

1 Comment

Are you referring to the array of arrays? If not, I don't quite understand.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.