Accessing variables from onclicklistener

后端 未结 2 1988
猫巷女王i
猫巷女王i 2021-01-22 11:59

So I have an onItemLongClickListener for a list view that gets a parameter \'int position\' passed in. Inside, I have an alertDialogBuilder which has two buttons. I have another

2条回答
  •  自闭症患者
    2021-01-22 12:29

    If you change position to final, then it should let you access it from within the onClick method.

提交回复
热议问题