I\'ve got a little piece of xml, which I\'ll be using in a lot of places in my app. For this reason I want to store it in a separate file. So I created mywidget.xml in which
Try this:
mContainerView = (LinearLayout)findViewById(R.id.parentView);
LayoutInflater inflater =(LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View myView = inflater.inflate(R.layout.row, null);
mContainerView.addView(myView);
mContainerView
is LinearLayout which contain your EditText
and row
is your xml filename.