View Custmv;
private void initViews() {
inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
Custmv = inflater.inflate(R.layout.id_number_edit_text_custom, this, true);
editText = (EditText) findViewById(R.id.id_number_custom);
loadButton = (ImageButton) findViewById(R.id.load_data_button);
loadButton.setVisibility(RelativeLayout.INVISIBLE);
loadData();
}
private void loadData(){
loadButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
EditText firstName = (EditText) Custmv.getParent().findViewById(R.id.display_name);
firstName.setText("Some Text");
}
});
}
try like this.