简体   繁体   中英

How to detect button press history on Android

I want to know how to find out which (programmed in) button was last pressed, and then act accordingly. Would I have to have an array of some kind?

您可以在类中拥有一个int变量,一旦按下按钮,便会使用按钮的ID更新该变量。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM