am 159a5ff7: fix a few bugs. xxhpi bug: 10071401 bitmap code, aosp: 58020 intent code, aosp: 57698

* commit '159a5ff708063d92a6be4ed12c7a3c9d85dec1e1':
  fix a few bugs. xxhpi bug: 10071401 bitmap code, aosp: 58020 intent code, aosp: 57698
This commit is contained in:
Scott Main
2013-07-30 20:05:46 -07:00
committed by Android Git Automerger
3 changed files with 16 additions and 15 deletions

View File

@ -312,7 +312,7 @@ without blurring or other scaling artifacts.</p>
<td>144x144 px</td> <td>144x144 px</td>
<td>96x96 px</td> <td>96x96 px</td>
<td>48x48 px</td> <td>48x48 px</td>
<td>74x74 px</td> <td>72x72 px</td>
</tr> </tr>
</table> </table>

View File

@ -172,7 +172,7 @@ Play</a>).</p>
<h2 id="StartActivity">Start an Activity with the Intent</h2> <h2 id="StartActivity">Start an Activity with the Intent</h2>
<div class="figure" style="width:200px"> <div class="figure" style="width:200px;margin-top:-10px">
<img src="{@docRoot}images/training/basics/intents-choice.png" alt="" /> <img src="{@docRoot}images/training/basics/intents-choice.png" alt="" />
<p class="img-caption"><strong>Figure 1.</strong> Example of the selection dialog that appears <p class="img-caption"><strong>Figure 1.</strong> Example of the selection dialog that appears
when more than one app can handle an intent.</p> when more than one app can handle an intent.</p>
@ -211,11 +211,9 @@ if (isIntentSafe) {
<h2 id="AppChooser">Show an App Chooser</h2> <h2 id="AppChooser">Show an App Chooser</h2>
<div class="figure" style="width:200px"> <div class="figure" style="width:200px;margin-top:-10px">
<img src="{@docRoot}images/training/basics/intent-chooser.png" alt="" /> <img src="{@docRoot}images/training/basics/intent-chooser.png" alt="" />
<p class="img-caption"><strong>Figure 2.</strong> Example of the chooser dialog that appears <p class="img-caption"><strong>Figure 2.</strong> A chooser dialog.</p>
when you use {@link android.content.Intent#createChooser createChooser()} to ensure
that the user is always shown a list of apps that respond to your intent.</p>
</div> </div>
<p>Notice that when you start an activity by passing your {@link android.content.Intent} to {@link <p>Notice that when you start an activity by passing your {@link android.content.Intent} to {@link
@ -223,11 +221,13 @@ android.app.Activity#startActivity startActivity()} and there is more than one a
the intent, the user can select which app to use by default (by selecting a checkbox at the bottom the intent, the user can select which app to use by default (by selecting a checkbox at the bottom
of the dialog; see figure 1). This is nice when performing an action for which the user of the dialog; see figure 1). This is nice when performing an action for which the user
generally wants to use the same app every time, such as when opening a web page (users generally wants to use the same app every time, such as when opening a web page (users
likely use just one web browser) or taking a photo (users likely prefer one camera). However, if likely use just one web browser) or taking a photo (users likely prefer one camera).</p>
the action to be performed could be handled by multiple apps and the user might
<p>However, if the action to be performed could be handled by multiple apps and the user might
prefer a different app each time&mdash;such as a "share" action, for which users might have several prefer a different app each time&mdash;such as a "share" action, for which users might have several
apps through which they might share an item&mdash;you should explicitly show a chooser dialog, apps through which they might share an item&mdash;you should explicitly show a chooser dialog
which forces the user to select which app to use for the action every time (the user cannot select a as shown in figure 2. The chooser dialog
forces the user to select which app to use for the action every time (the user cannot select a
default app for the action).</p> default app for the action).</p>
<p>To show the chooser, create an {@link android.content.Intent} using {@link <p>To show the chooser, create an {@link android.content.Intent} using {@link
@ -238,8 +238,9 @@ android.app.Activity#startActivity startActivity()}. For example:</p>
Intent intent = new Intent(Intent.ACTION_SEND); Intent intent = new Intent(Intent.ACTION_SEND);
... ...
// Always use string resources for UI text. This says something like "Share this photo with" // Always use string resources for UI text.
String title = getResources().getText(R.string.chooser_title); // This says something like "Share this photo with"
String title = (String) getResources().getText(R.string.chooser_title);
// Create and start the chooser // Create and start the chooser
Intent chooser = Intent.createChooser(intent, title); Intent chooser = Intent.createChooser(intent, title);
startActivity(chooser); startActivity(chooser);

View File

@ -324,14 +324,14 @@ private LruCache&lt;String, Bitmap&gt; mMemoryCache;
&#64;Override &#64;Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
... ...
RetainFragment mRetainFragment = RetainFragment retainFragment =
RetainFragment.findOrCreateRetainFragment(getFragmentManager()); RetainFragment.findOrCreateRetainFragment(getFragmentManager());
mMemoryCache = RetainFragment.mRetainedCache; mMemoryCache = retainFragment.mRetainedCache;
if (mMemoryCache == null) { if (mMemoryCache == null) {
mMemoryCache = new LruCache&lt;String, Bitmap&gt;(cacheSize) { mMemoryCache = new LruCache&lt;String, Bitmap&gt;(cacheSize) {
... // Initialize cache here as usual ... // Initialize cache here as usual
} }
mRetainFragment.mRetainedCache = mMemoryCache; retainFragment.mRetainedCache = mMemoryCache;
} }
... ...
} }