开发者

difference between intent and intenfilter in android

Hi friends can an开发者_运维知识库ybody tell what is the use of intent filter and what is difference between intent and intent filter

Thanks


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


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.


An intent is an object that can hold the os or other app activity and its data in uri form.It is started using startActivity(intent-obj)..\n whereas IntentFilter can fetch activity information on os or other app activities.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜