You can try something like this:
Inside customview constructor:
mContext = context;
Next inside customview you can call:
((MainActivity) mContext).updateText( text );
Inside MainAcivity
define:
public void updateText(final String text) {
TextView txtView = (TextView) findViewById(R.id.text);
txtView.setText(text);
}
It works for me.