Android : How use setID in android correctly?

on Sunday, April 19, 2015


I want to add layout with controls dynamically and in the future I want to save this data to DB.



public void onClickAdd(View view) {
LayoutInflater ltInflater = getLayoutInflater();
final LinearLayout subLayoutFields = (LinearLayout) findViewById(R.id.subLayoutFields);
LinearLayout subLayoutFields1;
final View view1 = ltInflater.inflate(R.layout.sub_fields, subLayoutFields, true);
subLayoutFields.setId(countID);
countID++;
}


And compiler did not finish successful.What's wrong with this?I get error on the



subLayoutFields.setId(countID);


Thank you...


0 comments:

Post a Comment