samedi 11 avril 2015

How to set OnTouchListener for toolbar popup (overflow) menu

If it's an image button, I can do this:



findViewById(R.id.action_settings).setOnTouchListener(listener)


But if it's in overflow menu, findViewById will return null. What's the easiest and most portable solution to this? (instead of A LOT OF reflection)






Aucun commentaire:

Enregistrer un commentaire