Why does a protected android:onClick method in Activity actually work?

前端 未结 2 1887
广开言路
广开言路 2021-02-01 15:51

Suppose you define android:onClick=\"doClick\" in your Activity as

protected void doClick(View view) { }

The document

2条回答
  •  我在风中等你
    2021-02-01 16:07

    As per "The Java™ Tutorials" : The protected modifier specifies that the member can only be accessed within its own package (as with package-private) and, in addition, by a subclass of its class in another package

提交回复
热议问题