title: onclick listener not working on ImageButton inside CollapsingToolbarLayout android
body: <p><a href="http://i.stack.imgur.com/rdETx.png" rel="nofollow">onclick function on edit image button not working</a>[In coordinatorLayout....Im inserting the image button to right of  collapsingToolbar title ,setOnClickListener not working on that image button.... You can find the code and images below. Any help is appreciated<a href="http://i.stack.imgur.com/U2gZg.png" rel="nofollow">2</a></p>
  
  <p></p>
  
  <pre><code>&lt;android.support.design.widget.AppBarLayout
      android:id="@+id/MyAppbar"
      android:layout_width="match_parent"
      android:layout_height="256dp"
      android:fitsSystemWindows="true"
      android:gravity="center_vertical"
      android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"&gt;
  
      &lt;android.support.design.widget.CollapsingToolbarLayout
          android:id="@+id/collapse_toolbar"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:fitsSystemWindows="true"
          app:contentScrim="?attr/colorPrimary"
          app:expandedTitleMarginEnd="64dp"
          app:expandedTitleMarginStart="48dp"
          app:layout_scrollFlags="scroll|exitUntilCollapsed"&gt;
  
          &lt;ImageButton
              android:id="@+id/bgheader"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:background="@drawable/nature"
              android:fitsSystemWindows="true"
              android:scaleType="centerCrop"
              app:layout_collapseMode="parallax" /&gt;
  
          &lt;android.support.v7.widget.Toolbar
              android:id="@+id/MyToolbar"
              android:layout_width="match_parent"
              android:layout_height="?attr/actionBarSize"
              app:layout_collapseMode="pin"
              app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_marginBottom="25dp"
              android:layout_marginRight="20dp"
              android:gravity="bottom|end"
              android:orientation="horizontal"
              app:layout_collapseMode="pin"&gt;
  
              &lt;ImageButton
                  android:id="@+id/txt_group_name"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:src="@drawable/edit"
                  android:onClick="dd"/&gt;
          &lt;/LinearLayout&gt;
      &lt;/android.support.design.widget.CollapsingToolbarLayout&gt;
  
  &lt;/android.support.design.widget.AppBarLayout&gt;
  
  &lt;android.support.v7.widget.RecyclerView
      android:id="@+id/recycler_view"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_below="@+id/relative1"
      android:padding="8dp"
      android:scrollbarStyle="outsideOverlay"
      android:scrollbars="vertical"
      app:layout_behavior="@string/appbar_scrolling_view_behavior" /&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>private View mGroupName;
     mGroupName = (View) findViewById(R.id.txt_group_name);
     mGroupName.setOnClickListener(this);
  
  @Override
      public void onClick(View v) {
          switch (v.getId()) {
              case R.id.txt_group_name: {
                  final EditText txtUrl = new EditText(GroupInformationActivity.this);
                  txtUrl.setText(group.getName());
                  new AlertDialog.Builder(GroupInformationActivity.this)
                          .setTitle("New name for the group")
                          .setView(txtUrl)
                          .setPositiveButton("Change", new DialogInterface.OnClickListener() {
                              public void onClick(DialogInterface dialog, int whichButton) {
                                  dialog.dismiss();
                                  String name = txtUrl.getText().toString();
                                  if (!group.getName().equals(name)) {
                                      collapsingToolbar.setTitle(name);
                                      new UpdateGroupTask().execute();
                                  }
                              }
                          })
                          .setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                              public void onClick(DialogInterface dialog, int whichButton) {
                              }
                          })
                          .show();
              }
  .......
  </code></pre>