Suresh
Suresh

Reputation: 79

Why class extending intentservice needs empty constructor?

Could anybody explain it and help me to understand it.?

Upvotes: 2

Views: 1791

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007296

All components (activities, services, content providers, and broadcast receivers) need an empty constructor, as that is how Android will attempt to create the object as needed. Android cannot use other constructors, because it has no way to know what to pass in as the parameter values.

Upvotes: 6

Related Questions