0

Screenshot of the App

enter image description here I have a DeviceLayout.xml file which has a list of buttons in a grid as shown below. I used to pull it using an include tag in the MainLayout.

No activity is defined for DeviceLayout. Just xml file.

Now, the devices in the image are statically added. I want to make the button creation dynamic. If user clicks the "Add Device" Button, a new popup has to come up asking the details of the Device and it should be displayed on the home.

Please help. No idea how to do this.

Chetan Ashtivkar
  • 194
  • 2
  • 15

1 Answers1

0

First, in your activity you should use an adapter to populate the gridview. Then, make your activity pass the dataset to be displayed to the gridview dynamically. After adding a new device in your dataset, just update the grid ( you can use a adapter's notifydatasetchanged method).

Federico Picci
  • 1,105
  • 10
  • 17