A ListView
has a list of elements which can be displayed by scroll, if you add another element that has its own scroll it would be a bit complicated to use it and it would not be recommended.
I have a listView in which I must load into it another
list of data, that is, in each item of the listView there is a button,
when you press that button you should bring me a list of data
I think it is advisable here that this button generates a list but within a LinearLayout
and not another listView
, for example the button within the ListView can generate a linear layout with its elements in the form of a list:
LinearLayout root = (LinearLayout) findViewById(R.id.my_root);
LinearLayout linearLayout = new LinearLayout(this);
linearLayout.setOrientation(LinearLayout.HORIZONTAL);
linearLayout.addView(myTextView1);
linearLayout.addView(myTextView2);
linearLayout.addView(myTextView3);
linearLayout.addView(myTextView4);
linearLayout.addView(myTextView5);
...
...
root.addView(linearLayout);