0

I want to create a new layout when clicking on a button, and use some script to make this new layout exactly like a pre-existing layout in a xml file.
My problem is not to create the base layout but to make it look like the "resource" layout.

Thanks in advance for your help :)

Peter suib
  • 108
  • 2
  • 10
  • u mean u want to create dynamic layout – Ashvin solanki Aug 04 '18 at 13:11
  • Possible duplicate of [Adding content to a linear layout dynamically?](https://stackoverflow.com/questions/6661261/adding-content-to-a-linear-layout-dynamically) – TAHA SULTAN TEMURI Aug 04 '18 at 13:39
  • uuh yeah it seems to be a Dynamic Layout I want to make, but I'd like to create a new Layout (with `Layout layout = new Layout()` I suppose) and making it like a layout already existing in a .xml file, but I don't know how to do – Peter suib Aug 04 '18 at 19:15

1 Answers1

-1

Try to consider fragment

A good starting point is a standard project "File>New Project>. In the add activity tab, select tabbed Activity.

You'll find many posts on stackoverflow on that subject.

AnthonyCFE
  • 71
  • 11
  • he want to create dynamic layout not fragments – Ashvin solanki Aug 04 '18 at 13:16
  • Yes, @Ashvinsolanki I've read the question. I'm just suggesting fragment as the snippet built by the project wizard gives an elegant answer. I guess this is leading to the same result + giving the ability to the user to navigate through "Inventories" – AnthonyCFE Aug 04 '18 at 13:28