Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 922e038b authored by Scott Main's avatar Scott Main Committed by Android Git Automerger
Browse files

am ea31b47a: Merge "fix misc doc bugs from external issues" into jb-dev

* commit 'ea31b47a':
  fix misc doc bugs from external issues
parents ceff3415 ea31b47a
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -640,12 +640,6 @@ href="{@docRoot}resources/samples/ApiDemos/index.html">ApiDemos</a>.</p>

<h2 id="Lifecycle">Managing the Lifecycle of a Bound Service</h2>

<div class="figure" style="width:588px">
<img src="{@docRoot}images/fundamentals/service_binding_tree_lifecycle.png" alt="" />
<p class="img-caption"><strong>Figure 1.</strong> The lifecycle for a service that is started
and also allows binding.</p>
</div>

<p>When a service is unbound from all clients, the Android system destroys it (unless it was also
started with {@link android.app.Service#onStartCommand onStartCommand()}). As such, you don't have
to manage the lifecycle of your service if it's purely a bound
@@ -667,6 +661,12 @@ onRebind()} returns void, but the client still receives the {@link android.os.IB
{@link android.content.ServiceConnection#onServiceConnected onServiceConnected()} callback.
Below, figure 1 illustrates the logic for this kind of lifecycle.</p>


<img src="{@docRoot}images/fundamentals/service_binding_tree_lifecycle.png" alt="" />
<p class="img-caption"><strong>Figure 1.</strong> The lifecycle for a service that is started
and also allows binding.</p>


<p>For more information about the lifecycle of an started service, see the <a
href="{@docRoot}guide/components/services.html#Lifecycle">Services</a> document.</p>

+6 −9
Original line number Diff line number Diff line
@@ -755,15 +755,6 @@ stopSelf()} does not actually stop the service until all clients unbind. </p>
changes in the service's state and perform work at the appropriate times. The following skeleton
service demonstrates each of the lifecycle methods:</p>


<div class="figure" style="width:432px">
<img src="{@docRoot}images/service_lifecycle.png" alt="" />
<p class="img-caption"><strong>Figure 2.</strong> The service lifecycle. The diagram on the left
shows the lifecycle when the service is created with {@link android.content.Context#startService
startService()} and the diagram on the right shows the lifecycle when the service is created
with {@link android.content.Context#bindService bindService()}.</p>
</div>

<pre>
public class ExampleService extends Service {
    int mStartMode;       // indicates how to behave if the service is killed
@@ -804,6 +795,12 @@ public class ExampleService extends Service {
<p class="note"><strong>Note:</strong> Unlike the activity lifecycle callback methods, you are
<em>not</em> required to call the superclass implementation of these callback methods.</p>

<img src="{@docRoot}images/service_lifecycle.png" alt="" />
<p class="img-caption"><strong>Figure 2.</strong> The service lifecycle. The diagram on the left
shows the lifecycle when the service is created with {@link android.content.Context#startService
startService()} and the diagram on the right shows the lifecycle when the service is created
with {@link android.content.Context#bindService bindService()}.</p>

<p>By implementing these methods, you can monitor two nested loops of the service's lifecycle: </p>

<ul>
+1 −1
Original line number Diff line number Diff line
@@ -270,7 +270,7 @@ density.</p>

<p>The density of a device's screen is based on the screen resolution, as defined by the number of
dots per inch (dpi). There are three screen
density categories supported by Android: low (ldpi), medium (mdpi), and high (mdpi). A screen
density categories supported by Android: low (ldpi), medium (mdpi), and high (hdpi). A screen
with low density has fewer available pixels per inch, whereas a screen with high density has more
pixels per inch (compared to a medium density screen). The Android Browser and {@link
android.webkit.WebView} target a medium density screen by default.</p>
+2 −2
Original line number Diff line number Diff line
@@ -88,13 +88,14 @@ Emulator 2, adb: 5557 ...
	<li>Serial number &mdash; A string created by adb to uniquely identify an emulator/device instance by its 
        console port number. The format of the serial number is <code>&lt;type&gt;-&lt;consolePort&gt;</code>. 
        Here's an example serial number: <code>emulator-5554</code></li>
	<li>State &mdash; The connection state of the instance. Three states are supported: 
	<li>State &mdash; The connection state of the instance may be one of the following:
		<ul>
		<li><code>offline</code> &mdash; the instance is not connected to adb or is not responding.</li>
		<li><code>device</code> &mdash; the instance is now connected to the adb server. Note that this state does not 
                    imply that the Android system is fully booted and operational, since the instance connects to adb 
                    while the system is still booting. However, after boot-up, this is the normal operational state of 
                    an emulator/device instance.</li>
                <li><code>no device</code> &mdash; there is no emulator/device connected.
		</ul>
	</li>
</ul>
@@ -111,7 +112,6 @@ emulator-5554&nbsp;&nbsp;device
emulator-5556&nbsp;&nbsp;device
emulator-5558&nbsp;&nbsp;device</pre>

<p>If there is no emulator/device running, adb returns <code>no device</code>.</p>


<a name="directingcommands"></a>
+1 −1
Original line number Diff line number Diff line
@@ -175,7 +175,7 @@ In that method, use {@link
android.view.accessibility.AccessibilityEvent#getEventType} to determine the
type of event, and {@link
android.view.accessibility.AccessibilityEvent#getContentDescription} to extract
any label text associated with the fiew that fired the event.</pre>
any label text associated with the view that fired the event.</pre>

<pre>
&#64;Override
Loading