android, Uncategorized

Bubbling OnClick events

Today, I ran into a problem where I needed to bubble up the OnClick event. Inside of a RelativeLayout, I had a TextView which I had to make clickable (so that it could get some animation) because of this, the OnClickevent got swallowed up. To get around this, in the constructor, I create an OnClickListener which would simply call performClick() from the parent.

Here’s how it goes:

final View parent = this;
mTitleView = (TextView) findViewById(;
mTitleView.setOnClickListener(new OnClickListener() {
    public void onClick(View v) {

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s