Image Button is not clickable - Android
<p><em>I can’t figure out why my button is not clickable. I have a list of songs in a gridview where when a user clicks one of the items from the list the app will take them to my SongDetailFragment activity which contains more information about the song. I have a star button where if a song in in the database I want it to be on like this btn_star_big_on, and if its NOT in the database I want it to be off btn_star_big_off. The problem is when I run my app I'm not able to click on the button. It's as if its just a static image when it's meant to be interactive because the user should be able to switch it on and off.</em> </p>

<p><strong>Can anyone please advise how to fix this?</strong></p>

<p><a href="http://www.darshancomputing.com/android/1.5-drawables.html" rel="nofollow">Here</a> is where I got my star button: </p>

<p>Here is my xml for the star button:</p>

<pre><code>&lt;ImageView
   android:id="@+id/imgFavBtn"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:clickable="true"
   android:contentDescription="@string/favourite"
   android:paddingTop="@dimen/activity_vertical_margin"
   android:src="@android:drawable/btn_star_big_off" /&gt;
</code></pre>

<p>Here is my Detail Fragment:</p>

<pre><code>public  class SongDetailFragment extends Fragment implements LoaderManager.LoaderCallbacks&lt;Cursor&gt;{
    private  Song song;
    private static final int CURSOR_LOADER_ID = 0;
    ImageView imgViewFavButton;
    Boolean mIsFavourite;

    public SongDetailFragment() {
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        View rootView = inflater.inflate(R.layout.song_fragment_detail, container, false);


        Intent intent = getActivity().getIntent();
        if (intent != null &amp;&amp; intent.hasExtra("song")) {


            song = intent.getParcelableExtra("song");

            ((TextView) rootView.findViewById(R.id.detail_title_textview))
                    .setText(song.getTitle());

            ((TextView)rootView.findViewById(R.id.detail_overview_textview))
                    .setText(song.getDescription());


            ((TextView)rootView.findViewById(R.id.song_date_textview))
                    .setText(song.getdate());




            ImageView imageView = (ImageView) rootView.findViewById(R.id.song_detail_poster_imageview);
            Picasso.with(getActivity()).load(song.getPoster()).into(imageView);
        }

        imgViewFavButton = (ImageView) rootView.findViewById(R.id.imgFavBtn);
        checkFavourites(song);
        imgViewFavButton.setOnClickListener(new View.OnClickListener()
        {
            @Override
            public void onClick(View v)
            {

                Cursor c =
                        getActivity().getContentResolver().query(songContract.songEntry.CONTENT_URI,
                                new String[]{songContract.songEntry._ID},
                                null,
                                null,
                                null);

                    insertData(song);

                 getLoaderManager().initLoader(CURSOR_LOADER_ID, null, songDetailFragment.this);

            }
        });

        return rootView;
    }


    public void insertData(song song){
        ContentValues songValues = new ContentValues();
        songValues.put(songContract.songEntry.COLUMN_ID, song.getsong_id());
        songValues.put(songContract.songEntry.COLUMN_IMAGE, song.getPoster());
        songValues.put(songContract.songEntry.COLUMN_TITLE, song.getTitle());
        songValues.put(songContract.songEntry.COLUMN_OVERVIEW, song.getDescription());
        songValues.put(songContract.songEntry.COLUMN_date, song.getdate());



        getActivity().getContentResolver().insert(songContract.songEntry.CONTENT_URI,
                songValues);

    }


    private void checkFavourites(song song) {
        Cursor c =
                getActivity().getContentResolver().query(songContract.songEntry.CONTENT_URI,
                        null,
                        songContract.songEntry.COLUMN_ID + " = ?",
                        new String[]{song.getsong_id()},
                        null);

        if (c != null) {
            c.moveToFirst();
            int index = c.getColumnIndex(songContract.songEntry.COLUMN_ID);

            if (c.getCount() &gt; 0 &amp;&amp; c.getString(index).equals(song.getsong_id())) {
                mIsFavourite = true;
                imgViewFavButton.setImageResource(android.R.drawable.btn_star_big_on);
            }

            else{
                 imgViewFavButton.setImageResource(android.R.drawable.btn_star_big_off);
            }
                c.close();

            }



    }


    @Override
    public Loader&lt;Cursor&gt; onCreateLoader(int id, Bundle args){
        return new CursorLoader(getActivity(),
                songContract.songEntry.CONTENT_URI,
                null,
                null,
                null,
                null);
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState){
        super.onViewCreated(view, savedInstanceState);
    }


    // Set the cursor in our CursorAdapter once the Cursor is loaded
    @Override
    public void onLoadFinished(Loader&lt;Cursor&gt; loader, Cursor data) {




    }

    // reset CursorAdapter on Loader Reset
    @Override
    public void onLoaderReset(Loader&lt;Cursor&gt; loader){

    }

}
</code></pre>