http://www.basef.com.br/index.php?title=Intents&feed=atom&action=historyIntents - Histórico de revisão2024-03-28T11:53:05ZHistórico de revisões para esta página neste wikiMediaWiki 1.26alphahttp://www.basef.com.br/index.php?title=Intents&diff=167&oldid=prevAdmin em 11h02min de 27 de abril de 20152015-04-27T11:02:45Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='pt-BR'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Edição anterior</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Edição das 11h02min de 27 de abril de 2015</td>
</tr><tr><td colspan="2" class="diff-lineno" id="L38" >Linha 38:</td>
<td colspan="2" class="diff-lineno">Linha 38:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* You can perform a query to a content provider by calling <code>query()</code> on a <code>ContentResolver</code>.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* You can perform a query to a content provider by calling <code>query()</code> on a <code>ContentResolver</code>.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>For more information about using intents, see the Intents and Intent Filters document. More information about activating specific components is also provided in the following documents: Activities, Services, <code>BroadcastReceiver</code> and Content Providers.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>For more information about using intents, see the Intents and Intent Filters document. More information about activating specific components is also provided in the following documents: Activities, Services, <code>BroadcastReceiver</code> and Content Providers.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Categoria:Android]]</ins></div></td></tr>
</table>Adminhttp://www.basef.com.br/index.php?title=Intents&diff=166&oldid=prevAdmin: Criou página com 'Intents bind individual components to each other at runtime (you can think of them as the messengers that request an action from other components), whether the component bel...'2015-04-27T11:02:31Z<p>Criou página com 'Intents bind individual components to each other at runtime (you can think of them as the messengers that request an action from other components), whether the component bel...'</p>
<p><b>Página nova</b></p><div>Intents bind individual components to each other at runtime (you can <br />
think of them as the messengers that request an action from other <br />
components), whether the component belongs to your application or <br />
another.<br />
<br />
An intent is created with an <code>Intent</code> object, which defines a message to activate either a specific component or a specific ''type'' of component—an intent can be either explicit or implicit, respectively.<br />
<br />
For<br />
<nowiki> </nowiki>activities and services, an intent defines the action to perform (for <br />
example, to "view" or "send" something) and may specify the URI of the <br />
data to act on (among other things that the component being started <br />
might need to know). For example, an intent might convey a request for <br />
an activity to show an image or to open a web page. In some cases, you <br />
can start an activity to receive a result, in which case, the activity <br />
also returns the result in an <code>Intent</code><br />
<nowiki> </nowiki>(for example, you can issue an intent to let the user pick a personal <br />
contact and have it returned to you—the return intent includes a URI <br />
pointing to the chosen contact).<br />
<br />
For broadcast receivers, the intent simply defines the announcement <br />
being broadcast (for example, a broadcast to indicate the device battery<br />
<nowiki> </nowiki>is low includes only a known action string that indicates "battery is <br />
low").<br />
<br />
The other component type, content provider, is not <br />
activated by intents. Rather, it is activated when targeted by a request<br />
<nowiki> </nowiki>from a <code>ContentResolver</code>.<br />
<nowiki> </nowiki>The content resolver handles all direct transactions with the content <br />
provider so that the component that's performing transactions with the <br />
provider doesn't need to and instead calls methods on the <code>ContentResolver</code><br />
<nowiki> </nowiki>object. This leaves a layer of abstraction between the content provider<br />
<nowiki> </nowiki>and the component requesting information (for security).<br />
<br />
There are separate methods for activiting each type of component:<br />
* You can start an activity (or give it something new to do) by passing an <code>Intent</code> to <code>startActivity()</code> or <code>startActivityForResult()</code> (when you want the activity to return a result).<br />
* You can start a service (or give new instructions to an ongoing service) by passing an <code>Intent</code> to <code>startService()</code>. Or you can bind to the service by passing an <code>Intent</code> to <code>bindService()</code>.<br />
* You can initiate a broadcast by passing an <code>Intent</code> to methods like <code>sendBroadcast()</code>, <code>sendOrderedBroadcast()</code>, or <code>sendStickyBroadcast()</code>.<br />
* You can perform a query to a content provider by calling <code>query()</code> on a <code>ContentResolver</code>.<br />
For more information about using intents, see the Intents and Intent Filters document. More information about activating specific components is also provided in the following documents: Activities, Services, <code>BroadcastReceiver</code> and Content Providers.</div>Admin