The Intent class had 6 constructors
Intent()
Create an empty intent.
Inten
Take a look at the argument Context
very closely in the fifth Intent declaration. It reflects polymorphism. The Intent
takes a Context
argument so you can pass any object that is a Context
or derives from the Context
class.
Activity, AppCompatActivity, IntentService, Service all derive from the Context
class and hence can be passed as an argument to the method.