user3478306
user3478306

Reputation: 29

Display a 2d array of buttons in android

I made a subclass of button called Block for a minesweeper like game. I then made a 2d array of this class. Is there an easy way to display this array in a grid?

Thanks

Upvotes: 2

Views: 733

Answers (1)

TmKVU
TmKVU

Reputation: 3000

You should use a GridView with a custom adapter. There is enough documentation available at the Android developer website

Here is a tutorial for a custom adapter. The tutorial uses a ListView, but the adapter will also work with a GridView

Upvotes: 1

Related Questions