Should I strictly avoid using enums on Android?

后端 未结 7 1943
不知归路
不知归路 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:22

    Two facts.

    1, Enum is one of the most powerful feature in JAVA.

    2, Android phone usually has a LOT of memory.

    So my answer is NO. I will use Enum in Android.

提交回复
热议问题