You are essentially replacing the inflation of a View with your dynamic View creation. To create a View programmatically, you need a Context
reference. You will need to add a class member and set it in the Adapter's constructor (this may not be exactly like yours, but you get the idea):
Context context;
public SomeAdapter(Context context, int resource)
{
super(context, resource);
this.context = context;
...
...
And then:
if (convertView == null)
{
EditText txtSrc = new EditText(context);
EditText txtDes = new EditText(context);
Button btnTranslate = new Button(context);
btnTranslate.setText("translate");
rl = new RelativeLayout(context);
rl.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
rl.addView(txtSrc);
rl.addView(btn_translate);
rl.addView(txtDes);
holder = new ViewHolder();
holder.txtSrc = txtSrc;
holder.btnTranslate = btnTranslate;
holder.txtDes = txtDes;
convertView = rl;
}