I was wondering if it was considered poor practice to create a single java class or enum that contained all my application’s different Intent actions. If not in a class or enum, then maybe one of the XML files? I plan on using LocalBroadcastManager to handle events to decrease coupling.
I was wondering if it was considered poor practice to create a single java
Share
I do not see anything particularly ‘good’ but surely it is possible to have a utility class consisting of
public static final Stringsrepresenting your actions. It should then have aprivateconstructor and you will not want to subclass from that class.I wouldn’t put the constants in an
interfacethough because you will have toimplementthat interface then but what you want is usage and not the implementation.There’s an advice in ‘Effective Java’ to avoid purely constant interfaces.