How to add this type of layout dynamically (android)

Smaran

this is the formatI have a format which will get repeated only the content of the image/the text inside it will change dynamically. This format will be added dynamically based on a web result

linear layout { linear layout { linear layout {image+text} linear layout {image+text} linear layout {image+text+image+text+image+text} } }

Muthu

Create a layout which holds your format. and declare a layout that's going to hold your dynamic view. using Layout inflater you can add many view as you like.

 LinearLayout ll = (LinearLayout) findViewById(R.id.parent);

    for(int i=0;i<result.length();i++){
    LayoutInflater inflater = (LayoutInflater) getSystemService( Context.LAYOUT_INFLATER_SERVICE );
    View format = inflater.inflate(R.layout.format, null);

    ll.addView(format);
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to add the layout dynamically

From Dev

Add a TextView dynamically in a layout ANDROID

From Dev

Android: How to dynamically add a "Custom View" into a linear layout

From Dev

How to dynamically include a layout in Android?

From Dev

Add Buttons to Relative Layout Dynamically or Extended Linear Layout android

From Dev

Add Buttons to Relative Layout Dynamically or Extended Linear Layout android

From Dev

How to dynamically add ImageView to layout using Adapter

From Dev

How to add 2 fragments dynamically in a single layout?

From Dev

How do I dynamically add buttons using Java in a given XML layout file in android studio?

From Dev

Android - How to dynamically change fragment layout

From Dev

How to create 2 column layout dynamically in android?

From Dev

How to change Layout background dynamically in Android?

From Dev

Android: How to dynamically change the Layout of my ViewPager

From Dev

Dynamically add layout to another layout

From Dev

how to add buttons dynamically in android?

From Dev

How to add data dynamically in android

From Dev

Dynamically add element to layout

From Dev

Dynamically add QWebEngineView to layout

From Dev

Row cannot add dynamically using code to Table Layout in Android

From Dev

Android layout dynamically issue

From Dev

how can i add and remove element dynamically from linear layout?

From Dev

How to add relative Layout below some element dynamically

From Dev

how to add controls dynamically to table layout panel from panel

From Dev

how to add to layout dynamically with multiple RelativeLayout.LayoutParams

From Dev

How do I add a LinearLayoutCompat view to an existing xml layout dynamically?

From Dev

Android: How to add on/off indicator in xml layout

From Dev

How to add two listviews in a fragment in android layout?

From Dev

How to add functions to buttons in an Android layout?

From Dev

How to add a new button in layout of the android programmatically

Related Related

  1. 1

    How to add the layout dynamically

  2. 2

    Add a TextView dynamically in a layout ANDROID

  3. 3

    Android: How to dynamically add a "Custom View" into a linear layout

  4. 4

    How to dynamically include a layout in Android?

  5. 5

    Add Buttons to Relative Layout Dynamically or Extended Linear Layout android

  6. 6

    Add Buttons to Relative Layout Dynamically or Extended Linear Layout android

  7. 7

    How to dynamically add ImageView to layout using Adapter

  8. 8

    How to add 2 fragments dynamically in a single layout?

  9. 9

    How do I dynamically add buttons using Java in a given XML layout file in android studio?

  10. 10

    Android - How to dynamically change fragment layout

  11. 11

    How to create 2 column layout dynamically in android?

  12. 12

    How to change Layout background dynamically in Android?

  13. 13

    Android: How to dynamically change the Layout of my ViewPager

  14. 14

    Dynamically add layout to another layout

  15. 15

    how to add buttons dynamically in android?

  16. 16

    How to add data dynamically in android

  17. 17

    Dynamically add element to layout

  18. 18

    Dynamically add QWebEngineView to layout

  19. 19

    Row cannot add dynamically using code to Table Layout in Android

  20. 20

    Android layout dynamically issue

  21. 21

    how can i add and remove element dynamically from linear layout?

  22. 22

    How to add relative Layout below some element dynamically

  23. 23

    how to add controls dynamically to table layout panel from panel

  24. 24

    how to add to layout dynamically with multiple RelativeLayout.LayoutParams

  25. 25

    How do I add a LinearLayoutCompat view to an existing xml layout dynamically?

  26. 26

    Android: How to add on/off indicator in xml layout

  27. 27

    How to add two listviews in a fragment in android layout?

  28. 28

    How to add functions to buttons in an Android layout?

  29. 29

    How to add a new button in layout of the android programmatically

HotTag

Archive