Guys, help, in general ... It is necessary in the loop to implement the creation of several TextViews and put them in a specific LinearLayout (with an index) Also, each created object should have its id. I don’t know how to do it in YouTube, if I did not find it. then you need to generate several objects (text) and drop them sequentially in LinearLayout, assigning your own id to each. Can you not help?
1 answer
ArrayList<TextView> txt = new ArrayList<>(); for (int i=0; i<10; i++) { TextView txtItem = new TextView(context); txt.add(txtItem); linearLayout.addView(txtItem); } - And what accepts TextView (context)? - BogdanBida
- I do not understand the question. - Serodv
- What should I write instead of context, what should it be? - BogdanBida
- Usually this if the call comes from the Activity class - Serodv
|