Should I strictly avoid using enums on Android?

后端 未结 7 1950
不知归路
不知归路 2020-11-29 15:36

I used to define a set of related constants like Bundle keys together in an interface like below:

public interface From{
    String LOGIN_SCREEN         


        
7条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-29 16:19

    With Android P, google has no restriction/objection in using enums

    The documentation has changed where before it was recommended to be cautious but it doesn't mention it now. https://developer.android.com/reference/java/lang/Enum

提交回复
热议问题