I am adding a Static and Dynamic text view simultaneously in android.but there is something wrong in the code..it is only adding the last element of array..Can You please help me to sort it out?
dynamicInput = (String[]) data;
runOnUiThread(new Runnable() {
public void run() {
String[] string = { "Customer Mobile No :", "Nick Name :",
"Amount :", "Due date :" };
LinearLayout findViewById = (LinearLayout) findViewById(R.id.dynamicInputbiller);
TextView dynamicText = new TextView(PayBiller_Activity.this);
TextView staticText = new TextView(PayBiller_Activity.this);
for (int i = 0; i < string.length; i++) {
staticText.setText(string[i]);
staticText.setTextColor(Color.BLACK);
staticText.setTextSize(TypedValue.COMPLEX_UNIT_SP, 17);
dynamicText.setText(dynamicInput[i]);
dynamicText.setTextColor(Color.GRAY);
dynamicText.setTextSize(TypedValue.COMPLEX_UNIT_SP, 13);
}
findViewById.addView(staticText);
findViewById.addView(dynamicText);
}
});