Maksim Dmitriev Maksim Dmitriev - 7 months ago 32
Android Question

Should I keep and its derived classes when building a release version of my app?

I read this answer and undestood why I should keep names of my services, activities, and custom views. But should I keep my classes which derive from

I also took a look at the defualt Proguard config file

, and there were no rules regarding fragments.


The main reason why you would need to keep a class, is because it is accessed via reflection.

Fragments are normally not accessed via reflection, so you don't have to keep them.

Except if you reference them directly in layout files (because parsing layout files uses reflection).