Reputation: 117
If I declare my fragment as private class, IDE will warn me that it should be public and if I ignore it app will crash at runtime. Question is: why everything works fine if I declare it as internal class? As I understand, fragments should be public to be able to be reinstantiated by Android itself, why it works with my internal classes?
Upvotes: 1
Views: 107
Reputation: 4806
From the JVM's perspective, internal
classes are public within the module.
Upvotes: 1