Yes, its ugly, don't do that.
In your onClick(View v)
get hold of TextView
by asking Activity holding the layout:
@Override
public void onClick(View v) {
TextView tv = (TextView) YourActivity.this
.findViewById(R.id.your_text_view_id);
tv.setText("blabla");
}
if you do it from fragment instead of activity use :
YourFragment.this.getView().findViewById(R.id.your_text_view_id)
Or simply create a member TextView mTv
, initialize it in your #OnCreate and use it everywhere as suggested in comments to your question