Home | History | Annotate | Download | only in app

Lines Matching defs:Activity

91  * An activity is a single, focused thing that the user can do.  Almost all
92 * activities interact with the user, so the Activity class takes care of
97 * or embedded inside of another activity (using {@link ActivityGroup}).
99 * There are two methods almost all subclasses of Activity will implement:
102 * <li> {@link #onCreate} is where you initialize your activity. Most
109 * activity. Most importantly, any changes made by the user should at this
115 * activity classes must have a corresponding
116 * {@link android.R.styleable#AndroidManifestActivity &lt;activity&gt;}
122 * <li><a href="#ActivityLifecycle">Activity Lifecycle</a>
132 * <p>The Activity class is an important part of an application's overall lifecycle,
148 * <p>Starting with {@link android.os.Build.VERSION_CODES#HONEYCOMB}, Activity
154 * <h3>Activity Lifecycle</h3>
156 * <p>Activities in the system are managed as an <em>activity stack</em>.
157 * When a new activity is started, it is placed on the top of the stack
158 * and becomes the running activity -- the previous activity always remains
160 * the new activity exits.</p>
162 * <p>An activity has essentially four states:</p>
164 * <li> If an activity in the foreground of the screen (at the top of
167 * <li>If an activity has lost focus but is still visible (that is, a new non-full-sized
168 * or transparent activity has focus on top of your activity), it
169 * is <em>paused</em>. A paused activity is completely alive (it
173 * <li>If an activity is completely obscured by another activity,
178 * <li>If an activity is paused or stopped, the system can drop the activity
184 * <p>The following diagram shows the important state paths of an Activity.
186 * perform operations when the Activity moves between states. The colored
187 * ovals are major states the Activity can be in.</p>
190 * alt="State diagram for an Android Activity Lifecycle." border="0" /></p>
193 * activity:
196 * <li>The <b>entire lifetime</b> of an activity happens between the first call
197 * to {@link android.app.Activity#onCreate} through to a single final call
198 * to {@link android.app.Activity#onDestroy}. An activity will do all setup
204 * <li>The <b>visible lifetime</b> of an activity happens between a call to
205 * {@link android.app.Activity#onStart} until a corresponding call to
206 * {@link android.app.Activity#onStop}. During this time the user can see the
207 * activity on-screen, though it may not be in the foreground and interacting
209 * are needed to show the activity to the user. For example, you can register
213 * can be called multiple times, as the activity becomes visible and hidden
216 * <li>The <b>foreground lifetime</b> of an activity happens between a call to
217 * {@link android.app.Activity#onResume} until a corresponding call to
218 * {@link android.app.Activity#onPause}. During this time the activity is
219 * in front of all other activities and interacting with the user. An activity
221 * the device goes to sleep, when an activity result is delivered, when a new
226 * <p>The entire lifecycle of an activity is defined by the following
227 * Activity methods. All of these are hooks that you can override
228 * to do appropriate work when the activity changes state. All
229 * activities will implement {@link android.app.Activity#onCreate}
231 * {@link android.app.Activity#onPause} to commit changes to data and
237 * public class Activity extends ApplicationContext {
254 * <p>In general the movement through an activity's lifecycle looks like
268 * <tr><th colspan="3" align="left" border="0">{@link android.app.Activity#onCreate onCreate()}</th>
269 * <td>Called when the activity is first created.
272 * provides you with a Bundle containing the activity's previously
280 * <th colspan="2" align="left" border="0">{@link android.app.Activity#onRestart onRestart()}</th>
281 * <td>Called after your activity has been stopped, prior to it being
288 * <tr><th colspan="2" align="left" border="0">{@link android.app.Activity#onStart onStart()}</th>
289 * <td>Called when the activity is becoming visible to the user.
290 * <p>Followed by <code>onResume()</code> if the activity comes
297 * <th align="left" border="0">{@link android.app.Activity#onResume onResume()}</th>
298 * <td>Called when the activity will start
299 * interacting with the user. At this point your activity is at
300 * the top of the activity stack, with user input going to it.
306 * <tr><th align="left" border="0">{@link android.app.Activity#onPause onPause()}</th>
308 * activity. This is typically used to commit unsaved changes to
311 * the next activity will not be resumed until this method returns.
312 * <p>Followed by either <code>onResume()</code> if the activity
320 * <tr><th colspan="2" align="left" border="0">{@link android.app.Activity#onStop onStop()}</th>
321 * <td>Called when the activity is no longer visible to the user, because
322 * another activity has been resumed and is covering this one. This
323 * may happen either because a new activity is being started, an existing
327 * this activity is coming back to interact with the user, or
328 * <code>onDestroy()</code> if this activity is going away.</td>
334 * <tr><th colspan="3" align="left" border="0">{@link android.app.Activity#onDestroy onDestroy()}</th>
336 * activity is destroyed. This can happen either because the
337 * activity is finishing (someone called {@link Activity#finish} on
339 * instance of the activity to save space. You can distinguish
341 * Activity#isFinishing} method.</td>
350 * activity may killed by the system <em>at any time</em> without another line
354 * {@link #onSaveInstanceState(Bundle)} is called before placing the activity
356 * state in your activity into the given Bundle, to be later received in
357 * {@link #onCreate} if the activity needs to be re-created.
373 * <p>For those methods that are not marked as being killable, the activity's
375 * is called and continuing after it returns. Thus an activity is in the killable
385 * configuration. Because Activity is the primary mechanism for interacting
391 * current activity to be <em>destroyed</em>, going through the normal activity
393 * {@link #onStop}, and {@link #onDestroy} as appropriate. If the activity
395 * called in that instance then a new instance of the activity will be
404 * that state, this is a convenient way to have an activity restart itself
408 * activity based on one or more types of configuration changes. This is
411 * that you handle there, you will receive a call to your current activity's
414 * activity will still be restarted and {@link #onConfigurationChanged}
420 * <p>The {@link android.app.Activity#startActivity}
422 * new activity, which will be placed at the top of the activity stack. It
424 * which describes the activity
427 * <p>Sometimes you want to get a result back from an activity when it
428 * ends. For example, you may start an activity that lets the user pick
431 * {@link android.app.Activity#startActivityForResult(Intent, int)}
433 * will come back through your {@link android.app.Activity#onActivityResult}
436 * <p>When an activity exits, it can call
437 * {@link android.app.Activity#setResult(int)}
443 * parent's <code>Activity.onActivityResult()</code>, along with the integer
446 * <p>If a child activity fails for any reason (such as crashing), the parent
447 * activity will receive a result with the code RESULT_CANCELED.</p>
450 * public class MyActivity extends Activity {
483 * <p>There are generally two kinds of persistent state than an activity
497 * start entering data, so that if they go to any other activity after
499 * <li> <p>When an activity's <code>onPause()</code> method is called, it should
502 * activity that is about to run. You will probably want to commit
504 * activity's lifecycle: for example before starting a new
505 * activity, before finishing your own activity, when the user
510 * between activities, and allows the system to safely kill an activity (because
513 * that the user pressing BACK from your activity does <em>not</em>
514 * mean "cancel" -- it means to leave the activity with its current contents
515 * saved away. Canceling edits in an activity must be provided through
522 * <p>The Activity class also provides an API for managing internal persistent state
523 * associated with an activity. This can be used, for example, to remember
527 * <p>Activity persistent state is managed
530 * modify a set of name/value pairs associated with the activity. To use
539 * <p>Here is an excerpt from a calendar activity that stores the user's
543 * public class CalendarActivity extends Activity {
572 * <p>The ability to start a particular Activity can be enforced when it is
574 * manifest's {@link android.R.styleable#AndroidManifestActivity &lt;activity&gt;}
577 * element in their own manifest to be able to start that activity.
579 * <p>When starting an Activity you can set {@link Intent#FLAG_GRANT_READ_URI_PERMISSION
582 * Activity access to the specific URIs in the Intent. Access will remain
583 * until the Activity has finished (it will remain across the hosting
585 * {@link android.os.Build.VERSION_CODES#GINGERBREAD}, if the Activity
598 * memory runs low. As described in <a href="#ActivityLifecycle">Activity
607 * <li> <p>The <b>foreground activity</b> (the activity at the top of the screen
613 * <li> <p>A <b>visible activity</b> (an activity that is visible to the user
616 * required to keep the foreground activity running.
617 * <li> <p>A <b>background activity</b> (an activity that is not visible to
621 * back to the activity (making it visible on the screen again), its
629 * background operation you do outside of an activity must be executed in the
630 * context of an activity BroadcastReceiver or Service to ensure that the system
634 * <p>Sometimes an Activity may need to do a long-running operation that exists
635 * independently of the activity lifecycle itself. An example may be a camera
638 * the application will it is executing. To accomplish this, your Activity
642 * upload, independent of whether the original activity is paused, stopped,
645 public class Activity extends ContextThemeWrapper
649 private static final String TAG = "Activity";
652 /** Standard activity result: operation canceled. */
654 /** Standard activity result: operation succeeded. */
656 /** Start of user-defined activity results. */
683 Activity mParent;
693 /** true if the activity is going through a transient pause */
695 /** true if the activity is being destroyed in order to recreate it with a new configuration */
703 Object activity;
727 return Activity.this.findViewById(id);
767 /** Return the intent that started this activity. */
786 /** Return the application that owns this activity. */
791 /** Is this activity embedded inside of another activity? */
796 /** Return the parent activity if this view is an embedded child. */
797 public final Activity getParent() {
807 * Retrieve the current {@link android.view.Window} for the activity.
809 * are not available through Activity/Screen.
811 * @return Window The current window, or null if the activity is not
848 * Window of this Activity to return the currently focused view.
860 * Called when the activity is starting. This is where most initialization
862 * activity's UI, using {@link #findViewById} to programmatically interact
869 * of the activity lifecycle ({@link #onStart}, {@link #onResume},
876 * @param savedInstanceState If the activity is being re-initialized after
908 * The hook for {@link ActivityThread} to restore the state of this activity.
921 * This method is called after {@link #onStart} when the activity is
999 * Called when activity start-up is complete (after {@link #onStart}
1008 * @param savedInstanceState If the activity is being re-initialized after
1023 * the activity had been stopped, but is now again being displayed to the
1052 * Called after {@link #onStop} when the current activity is being
1077 * {@link #onPause}, for your activity to start interacting with the user.
1081 * <p>Keep in mind that onResume is not the best indicator that your activity
1084 * activity is visible to the user (for example, to resume a game).
1102 * Called when activity resume is complete (after {@link #onResume} has
1124 * activity is re-launched while at the top of the activity stack instead
1125 * of a new instance of the activity being started, onNewIntent() will be
1129 * <p>An activity will always be paused before receiving a new intent, so
1135 * @param intent The new intent that was started for the activity.
1145 * The hook for {@link ActivityThread} to save the state of this activity.
1159 * Called to retrieve per-instance state from an activity before being killed
1164 * <p>This method is called before an activity may be killed so that when it
1166 * if activity B is launched in front of activity A, and at some point activity
1167 * A is killed to reclaim resources, activity A will have a chance to save the
1169 * returns to activity A, the state of the user interface can be restored
1172 * <p>Do not confuse this method with activity lifecycle callbacks such as
1173 * {@link #onPause}, which is always called when an activity is being placed
1177 * from activity B to activity A: there is no need to call {@link #onSaveInstanceState}
1180 * not {@link #onSaveInstanceState} is when activity B is launched in front of activity A:
1181 * the system may avoid calling {@link #onSaveInstanceState} on activity A if it isn't
1248 * Called as part of the activity lifecycle when an activity is going into
1252 * <p>When activity B is launched in front of activity A, this callback will
1257 * activity is editing, to present a "edit in place" model to the user and
1259 * the new activity without first killing this one. This is also a good
1261 * noticeable amount of CPU in order to make the switch to the next activity
1269 * per-instance state in the activity and this method is used to store
1273 * to {@link #onStop} (after the next activity has been resumed and
1292 * Called as part of the activity lifecycle when an activity is about to go
1295 * when an incoming phone call causes the in-call Activity to be automatically
1297 * the activity being interrupted. In cases when it is invoked, this method
1298 * is called right before the activity's {@link #onPause} callback.
1310 * Generate a new thumbnail for this activity. This method is called before
1311 * pausing the activity, and should draw into <var>outBitmap</var> the
1334 * Generate a new description for this activity. This method is called
1335 * before pausing the activity and can, if desired, return some textual
1339 * inherit the description from the previous activity. If all activities
1340 * return null, generally the label of the top activity will be used as the
1371 * depending on later user activity.
1374 * where the system does not have enough memory to keep your activity's
1395 * Perform any final cleanup before an activity is destroyed. This can
1396 * happen either because the activity is finishing (someone called
1398 * this instance of the activity to save space. You can distinguish
1402 * saving data! For example, if an activity is editing data in a content
1405 * free resources like threads that are associated with an activity, so
1406 * that a destroyed activity does not leave such things around while the
1408 * the system will simply kill the activity's hosting process without
1460 * purposes (calling it does not impact the visible behavior of the activity).
1463 * the system itself can determine is the point at which the activity's window
1483 * activity is running. Note that this will <em>only</em> be called if
1488 * and restart the activity (to have it launched with the new
1516 * If this activity is being destroyed because it can not handle a
1542 * be able to handle getting a null pointer back, and an activity must
1557 ? mLastNonConfigurationInstances.activity : null;
1562 * activity due to a configuration change, when it is known that a new
1564 * can return any object you like here, including the activity instance
1566 * {@link #getLastNonConfigurationInstance()} in the new activity
1580 * <li> A new instance of the activity will <em>always</em> be immediately
1583 * object does not have an activity to be associated with).
1586 * activity instance as described there.
1589 * <p>These guarantees are designed so that an activity can use this API
1590 * to propagate extensive state from the old to new activity instance, from
1597 * activity simplifies use with active objects. For example if your retained
1606 * next activity instance.
1625 * be able to handle getting a null pointer back, and an activity must
1640 * it should return either a mapping from child activity id strings to arbitrary objects,
1641 * or null. This method is intended to be used by Activity framework subclasses that control a
1650 Object activity = onRetainNonConfigurationInstance();
1672 if (activity == null && children == null && fragments == null && !retainLoaders) {
1677 nci.activity = activity;
1698 * with this activity.
1716 * Called when a Fragment is being attached to this activity, immediately
1727 * {@link #startManagingCursor} so that the activity will manage its
1735 * this method, because the activity will do that for you at the appropriate time. However, if
1767 * {@link #startManagingCursor} so that the activity will manage its
1775 * this method, because the activity will do that for you at the appropriate time. However, if
1804 * This method allows the activity to take care of managing the given
1805 * {@link Cursor}'s lifecycle for you based on the activity's lifecycle.
1806 * That is, when the activity is stopped it will automatically call
1808 * it will call {@link Cursor#requery} for you. When the activity is
1816 * {@link #managedQuery}, because the activity will do that for you at the appropriate time.
1839 * {@link #startManagingCursor}, stop the activity's management of that
1888 * Retrieve a reference to this activity's ActionBar.
1890 * @return The Activity's ActionBar, or null if it does not have one.
1920 * Set the activity content from a layout resource. The resource will be
1921 * inflated, adding all top-level views to the activity.
1934 * Set the activity content to an explicit view. This view is placed
1935 * directly into the activity's view hierarchy. It can itself be a complex
1954 * Set the activity content to an explicit view. This view is placed
1955 * directly into the activity's view hierarchy. It can itself be a complex
1970 * Add an additional content view to the activity. Added after any existing
1971 * ones in the activity -- existing views are NOT removed.
1982 * Sets whether this activity is finished when touched outside its window's
2014 * will start an application-defined search. (If the application or activity does not
2035 * Select the default key handling for this activity. This controls what
2046 * activity and its views always get a first chance to receive and handle
2081 * inside of the activity. So, for example, key presses while the cursor
2175 * inside of the activity. So, for example, key presses while the cursor
2179 * <p>The default implementation handles KEYCODE_BACK to stop the activity
2210 * Called when the activity has detected the user's press of the back
2211 * key. The default implementation simply finishes the current activity,
2221 * Called when a key shortcut event is not handled by any of the views in the Activity.
2222 * Override this method to implement global key shortcuts for the Activity.
2255 * views inside of the activity
2273 * views inside of the activity.
2302 * activity. Implement this method if you wish to know that the user has
2303 * interacted with the device in some way while your activity is running.
2308 * <p>All calls to your activity's {@link #onUserLeaveHint} callback will
2310 * ensures that your activity will be told of relevant user activity such
2325 // this activity is not embedded.
2338 * Called when the current {@link Window} of the activity gains or loses
2339 * focus. This is the best indicator of whether this activity is visible
2344 * is managed independently of activity lifecycles. As such, while focus
2346 * activity that is stopped will not generally get window focus), you
2350 * <p>As a general rule, however, a resumed activity will have window
2352 * input focus, in which case the activity itself will not have focus
2356 * pausing the foreground activity.
2358 * @param hasFocus Whether the window of this activity has focus.
2368 * Called when the main window associated with the activity has been
2378 * Called when the main window associated with the activity has been
2388 * Returns true if this activity's <em>main</em> window currently has window focus.
2391 * @return True if this activity's main window currently has window focus.
2534 * so that subclasses of Activity don't need to deal with feature codes.
2552 * Activity don't need to deal with feature codes.
2587 * Activity don't need to deal with feature codes.
2635 * so that subclasses of Activity don't need to deal with feature codes.
2667 * Initialize the contents of the Activity's standard options menu. You
2683 * <p>When you add items to the menu, you can implement the Activity's
2708 * activity's state. Deriving classes should always call through to the
2753 * activity hierarchy from the action bar.
2756 * was specified in the manifest for this activity or an activity-alias to it,
2757 * default Up navigation will be handled automatically. If any activity
2758 * along the parent chain requires extra Intent arguments, the Activity subclass
2766 * <p>See the {@link TaskStackBuilder} class and the Activity methods
2771 * @return true if Up navigation completed successfully and this Activity was finished,
2781 // specify a parent activity intent in the first place. Just finish
2782 // the current activity and call it a day.
2791 // Fall back and simply finish the current activity instead.
2794 Log.i(TAG, "onNavigateUp only finishing topmost activity to return a result");
2808 * This is called when a child activity of this one attempts to navigate up.
2809 * The default implementation simply calls onNavigateUp() on this activity (the parent).
2811 * @param child The activity making the call.
2813 public boolean onNavigateUpFromChild(Activity child) {
2821 * <p>The default implementation of this method adds the parent chain of this activity
2903 * {@link OnCreateContextMenuListener} on the view to this activity, so
2990 * by the activity. The default implementation calls through to
2996 * <p>If you use {@link #showDialog(int)}, the activity will call through to
3001 * <p>If you would like the activity to manage saving and restoring dialogs
3045 * will set this Activity as the owner activity on the Dialog.
3079 * Show a dialog managed by this activity. A call to {@link #onCreateDialog(int, Bundle)}
3165 + "shown via Activity#showDialog");
3169 * Removes any internal references to a dialog managed by this Activity.
3205 * menu item, search button, or other widgets within your activity. Unless overidden,
3208 * search for the current activity as specified in its manifest, see {@link SearchManager}.
3213 * @return Returns {@code true} if search launched, and {@code false} if activity blocks it.
3227 * Activity.onSearchRequested() or from an overridden version in any given
3228 * Activity. If your goal is simply to activate search, it is preferred to call
3229 * onSearchRequested(), which may have been overriden elsewhere in your Activity. If your goal
3247 * search is defined in the current application or activity, global search will be launched.
3276 * Request that key events come to this activity. Use this if your
3277 * activity has no views with focus, but the activity still wants
3378 * onActivityResult() when the activity exits.
3389 * Launch an activity for which you would like a result when it finished.
3390 * When this activity exits, your
3393 * {@link #startActivity} (the activity is not launched as a sub-activity).
3398 * not get the result when you expect. For example, if the activity you
3404 * activity, then your window will not be displayed until a result is
3405 * returned back from the started activity. This is to avoid visible
3406 * flickering when redirecting to another activity.
3409 * if there was no Activity found to run the given Intent.
3413 * onActivityResult() when the activity exits.
3414 * @param options Additional options for how the Activity should be started.
3435 // the activity visible until the result is received. Setting
3437 // activity hidden during this time, to avoid flickering.
3440 // activity is finished, no matter what happens to it.
3491 * onActivityResult() when the activity exits.
3509 * to use a IntentSender to describe the activity to be started. If
3510 * the IntentSender is for an activity, that activity will be started
3518 * onActivityResult() when the activity exits.
3526 * @param options Additional options for how the Activity should be started.
3550 Intent fillInIntent, int flagsMask, int flagsValues, Activity activity,
3562 fillInIntent, resolvedType, mToken, activity.mEmbeddedID,
3572 // the activity visible until the result is received. Setting
3574 // activity hidden during this time, to avoid flickering.
3577 // activity is finished, no matter what happens to it.
3599 * Launch a new activity. You will not receive any information about when
3600 * the activity exits. This implementation overrides the base version,
3602 * the activity performing the launch. Because of this additional
3604 * required; if not specified, the new activity will be added to the
3608 * if there was no Activity found to run the given Intent.
3611 * @param options Additional options for how the Activity should be started.
3648 * Launch a new activity. You will not receive any information about when
3649 * the activity exits. This implementation overrides the base version,
3651 * the activity performing the launch. Because of this additional
3653 * required; if not specified, the new activity will be added to the
3657 * if there was no Activity found to run the given Intent.
3660 * @param options Additional options for how the Activity should be started.
3709 * @param options Additional options for how the Activity should be started.
3735 * onActivityResult() when the activity exits, as described in
3738 * @return If a new activity was launched then true is returned; otherwise
3749 * A special variation to launch an activity only if a new activity
3755 * and the activity
3757 * activity, then a new instance is not needed. In this case, instead of
3761 * <p>This function can only be called from a top-level activity; if it is
3762 * called from a child activity, a runtime exception will be thrown.
3766 * onActivityResult() when the activity exits, as described in
3768 * @param options Additional options for how the Activity should be started.
3772 * @return If a new activity was launched then true is returned; otherwise
3798 // the activity visible until the result is received. Setting
3800 // activity hidden during this time, to avoid flickering.
3803 // activity is finished, no matter what happens to it.
3810 "startActivityIfNeeded can only be called from a top-level activity");
3817 * @param intent The intent to dispatch to the next activity. For
3819 * your own activity; the only changes you can make are to the extras
3822 Activity
3823 * to start: true if there was a next activity to start, false if there
3832 * Special version of starting an activity, for use when you are replacing
3833 * other activity components. You can use this to hand the Intent off
3834 * to the next Activity that can handle it. You typically call this in
3837 * @param intent The intent to dispatch to the next activity. For
3839 * your own activity; the only changes you can make are to the extras
3841 * @param options Additional options for how the Activity should be started.
3845 * @return Returns a boolean indicating whether there was another Activity
3846 * to start: true if there was a next activity to start, false if there
3864 "startNextMatchingActivity can only be called from a top-level activity");
3868 * Same as calling {@link #startActivityFromChild(Activity, Intent, int, Bundle)}
3871 * @param child The activity making the call.
3880 public void startActivityFromChild(Activity child, Intent intent,
3886 * This is called when a child activity of this one calls its
3890 * if there was no Activity found to run the given Intent.
3892 * @param child The activity making the call.
3895 * @param options Additional options for how the Activity should be started.
3904 public void startActivityFromChild(Activity child, Intent intent,
3936 * This is called when a Fragment in this activity calls its
3941 * if there was no Activity found to run the given Intent.
3946 * @param options Additional options for how the Activity should be started.
3969 * Same as calling {@link #startIntentSenderFromChild(Activity, IntentSender,
3972 public void startIntentSenderFromChild(Activity child, IntentSender intent,
3981 * Like {@link #startActivityFromChild(Activity, Intent, int)}, but
3986 public void startIntentSenderFromChild(Activity child, IntentSender intent,
4003 * you to specify a custom animation even when starting an activity from
4004 * outside the context of the current top activity.
4007 * the incoming activity. Use 0 for no animation.
4009 * the outgoing activity. Use 0 for no animation.
4020 * Call this to set the result that your activity will return to its
4024 * activity, often RESULT_CANCELED or RESULT_OK
4039 * Call this to set the result that your activity will return to its
4046 * Activity receiving the result access to the specific URIs in the Intent.
4047 * Access will remain until the Activity has finished (it will remain across the hosting
4052 * activity, often RESULT_CANCELED or RESULT_OK
4053 * @param data The data to propagate back to the originating activity.
4068 * Return the name of the package that invoked this activity. This is who
4073 * <p class="note">Note: if the calling activity is not expecting a result (that is it
4084 * @return The package of the activity that will receive your
4096 * Return the name of the activity that invoked this activity. This is
4101 * <p class="note">Note: if the calling activity is not expecting a result (that is it
4106 * @return The ComponentName of the activity that will receive your
4118 * Control whether this activity's main window is visible. This is intended
4119 * only for the special case of an activity that is not going to show a
4125 * {@link android.R.attr#windowNoDisplay} attribute of the activity's theme.
4147 * Check to see whether this activity is in the process of finishing,
4150 * {@link #onPause} to determine whether the activity is simply pausing or
4153 * @return If the activity is finishing, returns true; else returns false.
4163 * on the Activity, so this instance is now dead.
4170 * Check to see whether this activity is in the process of being destroyed in order to be
4173 * on to the next instance of the activity via {@link #onRetainNonConfigurationInstance()}.
4175 * @return If the activity is being torn down in order to be recreated with a new configuration,
4183 * Cause this Activity to be recreated with a new instance. This results
4184 * in essentially the same flow as when the Activity is created due to
4190 throw new IllegalStateException("Can only be called on top-level activity");
4199 * Call this when your activity is done and should be closed. The
4229 * Finish this activity as well as all activities immediately below it
4239 * to the previous activity, and an exception will be thrown if you are trying
4244 throw new IllegalStateException("Can not be called from an embedded activity");
4259 * This is called when a child activity of this one calls its
4261 * finish() on this activity (the parent), finishing the entire group.
4263 * @param child The activity making the call.
4267 public void finishFromChild(Activity child) {
4272 * Force finish another activity that you had previously started with
4275 * @param requestCode The request code of the activity that you had
4294 * This is called when a child activity of this one calls its
4297 * @param child The activity making the call.
4299 * activity.
4301 public void finishActivityFromChild(Activity child, int requestCode) {
4311 * Called when an activity you launched exits, giving you the requestCode
4314 * {@link #RESULT_CANCELED} if the activity explicitly returned that,
4318 * activity is re-starting.
4323 * @param resultCode The integer result code returned by the child activity
4381 * Change the desired orientation of this activity. If the activity
4384 * the activity to be restarted). Otherwise, this will be used the next
4385 * time the activity is visible.
4404 * Return the current requested orientation of the activity. This will
4427 * Return the identifier of the task this activity is in. This identifier
4428 * will remain the same for the lifetime of the activity.
4442 * Return whether this activity is the root of a task. The root is the
4443 * first activity in a task.
4445 * @return True if this is the root activity, else false.
4457 * Move the task containing this activity to the back of the activity
4458 * stack. The activity's order within the task is unchanged.
4460 * @param nonRoot If false then this only works if the activity is the root
4461 * of a task; if true it will work for any activity in
4478 * Returns class name for this activity with the package prefix removed.
4495 * Returns complete component name of this activity.
4497 * @return Returns the complete component name for this activity
4506 * that are private to this activity. This simply calls the underlying
4507 * {@link #getSharedPreferences(String, int)} method by passing in this activity's
4546 * Change the title associated with this activity. If this is a
4547 * top-level activity, the title for its window will change. If it
4548 * is an embedded activity, the parent can do whatever it wants
4561 * Change the title associated with this activity. If this is a
4562 * top-level activity, the title for its window will change. If it
4563 * is an embedded activity, the parent can do whatever it wants
4595 protected void onChildTitleChanged(Activity childActivity, CharSequence title) {
4674 * The suggested audio stream will be tied to the window of this Activity.
4675 * If the Activity is switched, the stream set here is no longer the
4737 * of the activity.
4822 * Print the Activity's state into the given stream. This gets invoked if
4823 * you run "adb shell dumpsys activity &lt;activity_component_name&gt;".
4836 writer.print(prefix); writer.print("Local Activity ");
4870 * Bit indicating that this activity is "immersive" and should not be
4889 * Convert a translucent themed Activity {@link android.R.attr#windowIsTranslucent} to a
4890 * fullscreen opaque Activity.
4892 * Call this whenever the background of a translucent Activity has changed to become opaque.
4893 * Doing so will allow the {@link android.view.Surface} of the Activity behind to be released.
4915 * Convert a translucent themed Activity {@link android.R.attr#windowIsTranslucent} back from
4918 * Calling this allows the Activity behind this one to be seen again. Once all such Activities
4920 * be called indicating that it is safe to make this activity translucent again. Until
4922 * behind the frontmost Activity will be indeterminate.
4928 * drawn and it is safe to make this Activity translucent again.
4959 * Note that changing this value will have no effect on the activity's
4962 * in the application's manifest entry for this activity, the {@link
4991 * Give the Activity a chance to control the UI for an action mode requested
4995 * has been started for this activity, see {@link #onActionModeStarted(ActionMode)}.</p>
4998 * @return The new action mode, or <code>null</code> if the activity does not want to
5011 * Notifies the Activity that an action mode has been started.
5012 * Activity subclasses overriding this method should call the superclass implementation.
5021 * Notifies the activity that an action mode has finished.
5022 * Activity subclasses overriding this method should call the superclass implementation.
5031 * Returns true if the app should recreate the task when navigating 'up' from this activity
5064 * Navigate from this activity to the activity specified by upIntent, finishing this activity
5065 * in the process. If the activity indicated by upIntent already exists in the task's history,
5066 * this activity and all others before the indicated activity in the history stack will be
5069 * <p>If the indicated activity does not appear in the history stack, this will finish
5070 * each activity in this task until the root activity of the task is reached, resulting in
5072 * when an activity may be reached by a path not passing through a canonical parent
5073 * activity.</p>
5081 * @return true if up navigation successfully reached the activity indicated by upIntent and
5082 * upIntent was delivered to it. false if an instance of the indicated activity could
5083 * not be found and this activity was simply finished normally.
5118 * This is called when a child activity of this one calls its
5120 * navigateUpTo(upIntent) on this activity (the parent).
5122 * @param child The activity making the call.
5125 * @return true if up navigation successfully reached the activity indicated by upIntent and
5126 * upIntent was delivered to it. false if an instance of the indicated activity could
5127 * not be found and this activity was simply finished normally.
5129 public boolean navigateUpToFromChild(Activity child, Intent upIntent) {
5134 * Obtain an {@link Intent} that will launch an explicit target activity specified by
5135 * this activity's logical parent. The logical parent is named in the application's manifest
5137 * Activity subclasses may override this method to modify the Intent returned by
5141 * @return a new Intent targeting the defined parent of this activity or null if
5150 // If the parent itself has no parent, generate a main activity intent.
5168 final void setParent(Activity parent) {
5174 Activity parent, String id, NonConfigurationInstances lastNonConfigurationInstances,
5183 CharSequence title, Activity parent, String id,
5244 "Activity " + mComponent.toShortString() +
5294 "Activity " + mComponent.toShortString() +
5313 "Activity " + mComponent.toShortString() +
5326 "Activity " + mComponent.toShortString() +
5340 "Activity " + mComponent.toShortString() +
5379 "Activity " + mComponent.toShortString() +
5433 * Interface for informing a translucent {@link Activity} once all visible activities below it
5434 * have completed drawing. This is necessary only after an {@link Activity} has been made
5435 * opaque using {@link Activity#convertFromTranslucent()} and before it has been drawn
5437 * Activity#convertToTranslucent(TranslucentConversionListener)}.
5443 * Callback made following {@link Activity#convertToTranslucent} once all visible Activities
5445 * Activity translucent because the underlying Activity has been drawn.
5447 * @param drawComplete True if the background Activity has drawn itself. False if a timeout
5448 * occurred waiting for the Activity to complete drawing.
5450 * @see Activity#convertFromTranslucent()
5451 * @see Activity#convertToTranslucent(TranslucentConversionListener)