Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difference between intent and intenfilter in android

Tags:

android

Hi friends can anybody tell what is the use of intent filter and what is difference between intent and intent filter

Thanks

like image 828
mohan Avatar asked May 07 '11 08:05

mohan


2 Answers

An Intent is an object passed to Context.startActivity(),Context.startService() or Activity.startActivityForResult() etc. to launch an activity or get an existing activity to do something new.

While an Intent filter describes a capability of the component(like activities, services, and broadcast receivers )

For more details see this

like image 108
Dinesh Sharma Avatar answered Nov 23 '22 03:11

Dinesh Sharma


Intent's are used to start new activity from the current activity. With two ways
1) Activity.startActivity(intent); 2) Activity.startActivityForResult(intent,rqwuestCode); //The above thing's you need to put in .java file

Intent-filter you need to mention on manifeast file.

// Intent filter are used for broadcast receiver. Whenever the intent filter condition is match the android OS will launch that activity.

like image 44
Sumant Avatar answered Nov 23 '22 03:11

Sumant