Android cannot find method from button's onClick in ListView Row

后端 未结 4 1900
甜味超标
甜味超标 2021-01-18 23:10

I have a ListView populated from a custom adapter. Each row has 1 button in it. In the xml the button has the onClick attribute passed. I have only the xml, not any OnClickL

4条回答
  •  有刺的猬
    2021-01-19 00:06

    When creating the custom Adapter, I was passing as the Context the result of the getApplicationContext() method. This was wrong. I should pass this (my custom Activity) as the Context. It works like a charm now.

提交回复
热议问题