مطالب تئوری - بخش 2
آشنایی با Intent
آدرس محتوای اصلی: http://developer.android.com/guide/components/fundamentals.html
(بخشی از محتوای این آدرس مد نظر است) ادامه مطلب را مشاهده بفرمایید...
Intents
Three of the core components of an application — activities, services, and
broadcast receivers — are activated through messages, called intents.
Intent messaging is a facility for late run-time binding between components in the same
or different applications. The intent itself, an Intent
object, is a passive data structure holding an abstract description of an operation
to be performed — or, often in the case of broadcasts, a description of something
that has happened and is being announced. There are separate mechanisms for
delivering intents to each type of component:
- An Intent object is passed to
orContext.startActivity()
to launch an activity or get an existing activity to do something new. (It can also be passed toActivity.startActivityForResult()
to return information to the activity that calledActivity.setResult()
startActivityForResult()
.) An Intent object is passed to
to initiate a service or deliver new instructions to an ongoing service. Similarly, an intent can be passed toContext.startService()
to establish a connection between the calling component and a target service. It can optionally initiate the service if it's not already running.Context.bindService()
Intent objects passed to any of the broadcast methods (such as
,Context.sendBroadcast()
, orContext.sendOrderedBroadcast()
) are delivered to all interested broadcast receivers. Many kinds of broadcasts originate in system code.Context.sendStickyBroadcast()
In each case, the Android system finds the appropriate activity, service, or set
of broadcast receivers to respond to the intent, instantiating them if necessary.
There is no overlap within these messaging systems: Broadcast intents are delivered
only to broadcast receivers, never to activities or services. An intent passed to
startActivity()
is delivered only to an activity, never to a service or
broadcast receiver, and so on.
- ۹۲/۰۳/۱۴
اگر قبلا در بیان ثبت نام کرده اید لطفا ابتدا وارد شوید، در غیر این صورت می توانید ثبت نام کنید.