setonitemclicklistener not working for gridview

前端 未结 1 1440
眼角桃花
眼角桃花 2021-01-28 16:57

Here\'s My Code the code, I\'m not getting any response from gridview setOnClickListener. Please Help me out.

setContentView(R.layout.myfav);
gView = (GridView)          


        
1条回答
  •  北恋
    北恋 (楼主)
    2021-01-28 17:11

    It could be that some items in your GridView are stealing focus. Try adding these attributes to any elements you have inside the grid:

    android:focusable="false"
    android:focusableInTouchMode="false"
    

    0 讨论(0)
提交回复
热议问题