Horje
add dynamic view in android from xml Code Example
add dynamic view in android from xml
// Parent layout
LinearLayout parentLayout = (LinearLayout)findViewById(R.id.layout);

// Layout inflater
LayoutInflater layoutInflater = getLayoutInflater();
View view;

for (int i = 1; i < 101; i++){
    // Add the text layout to the parent layout
    view = layoutInflater.inflate(R.layout.text_layout, parentLayout, false);

    // In order to get the view we have to use the new view with text_layout in it
    TextView textView = (TextView)view.findViewById(R.id.text);
    textView.setText("Row " + i);

    // Add the text view to the parent layout
    parentLayout.addView(textView);
}




Java

Related
2d matrix multiplication Code Example 2d matrix multiplication Code Example
online java http request demo Code Example online java http request demo Code Example
android java string animations Code Example android java string animations Code Example
how to find a number in a string java Code Example how to find a number in a string java Code Example
nested for each loop java Code Example nested for each loop java Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9