8 * http://www.apache.org/licenses/LICENSE-2.0 9 * /* 2 * Copyright (C) 2006 The Android Open Source Project 3 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */

"Activity"

/** Standard activity result: operation canceled. */

0

/** Standard activity result: operation succeeded. */

1

/** Start of user-defined activity results. */

1

"android:fragments"

"android:viewHierarchyState"

"android:savedDialogIds"

"android:savedDialogs"

"android:dialog_"

"android:dialog_args_"

// set by the thread after the constructor and before onCreate(Bundle savedInstanceState) is called.

/*package*/

/*package*/

/*package*/

/*package*/

/*package*/

/** true if the activity is going through a transient pause */

/*package*/

/** true if the activity is being destroyed in order to recreate it with a new configuration */

/*package*/

/*package*/

/*package*/

/* package */

/*package*/

/*package*/

/*package*/

/*package*/

/*package*/

0

// protected by synchronized (this)

"unused"

/** Return the intent that started this activity. */

@link #getIntent}. This holds a @link #onNewIntent}. 771 * @param newIntent The new Intent object to return from getIntent 773 * @see #getIntent @see #onNewIntent /** 767 * Change the intent returned by {#getIntent}. This holds a 768 * reference to the given intent; it does not copy it. Often used in 769 * conjunction with {#onNewIntent}. 770 newIntent The new Intent object to return from getIntent 772 #getIntent 774 #onNewIntent 775 */

/** Return the application that owns this activity. */

/** Is this activity embedded inside of another activity? */

/** Return the parent activity if this view is an embedded child. */

/** Retrieve the window manager for showing custom windows. */

@link android.view.Window} for the activity. Screen. 804 * 805 * @return Window The current window, or null if the activity is not /** 801 * Retrieve the current {android.view.Window} for the activity. 802 * This can be used to directly access parts of the Window API that 803 * are not available through Activity Window The current window, or null if the activity is not 806 * visual. 807 */

/** 813 * Return the LoaderManager for this fragment, creating it if needed. 814 */

@link android.view.Window#getCurrentFocus} on the 844 * @return View The current View with focus or null. 846 * @see #getWindow @see android.view.Window#getCurrentFocus /** 841 * Calls {android.view.Window#getCurrentFocus} on the 842 * Window of this Activity to return the currently focused view. 843 View The current View with focus or null. 845 #getWindow 847 android.view.Window#getCurrentFocus 848 */

@link #setContentView(int)} to inflate the @link #findViewById} to programmatically interact @link #managedQuery(android.net.Uri , String[], String, String[], String)} to retrieve @link #finish} from within this function, in @link #onStart}, {@link #onResume}, @link #onPause}, etc) executing. 870 * @param savedInstanceState If the activity is being re-initialized after @link #onSaveInstanceState}. <b><i>Note: Otherwise it is null.</i></b> 874 * @see #onStart @see #onSaveInstanceState @see #onRestoreInstanceState @see #onPostCreate /** 854 * Called when the activity is starting. This is where most initialization 855 * should go: calling {#setContentView(int)} to inflate the 856 * activity's UI, using {#findViewById} to programmatically interact 857 * with widgets in the UI, calling 858 * {#managedQuery(android.net.Uri , String[], String, String[], String)} to retrieve 859 * cursors for data being displayed, etc. 860 861 * You can call {#finish} from within this function, in 862 * which case onDestroy() will be immediately called without any of the rest 863 * of the activity lifecycle ({#onStart}, {#onResume}, 864 * {#onPause}, etc) executing. 865 866 * Derived classes must call through to the super class's 867 * implementation of this method. If they do not, an exception will be 868 * thrown. 869 savedInstanceState If the activity is being re-initialized after 871 * previously being shut down then this Bundle contains the data it most 872 * recently supplied in {#onSaveInstanceState}. Note: Otherwise it is null. 873 #onStart 875 #onSaveInstanceState 876 #onRestoreInstanceState 877 #onPostCreate 878 */

"onCreate "

": "

@link ActivityThread} to restore the state of this activity. @link #onSaveInstanceState(android.os.Bundle)} and @link #restoreManagedDialogs(android.os.Bundle)}. 907 * @param savedInstanceState contains the saved state /** 902 * The hook for {ActivityThread} to restore the state of this activity. 903 904 * Calls {#onSaveInstanceState(android.os.Bundle)} and 905 * {#restoreManagedDialogs(android.os.Bundle)}. 906 savedInstanceState contains the saved state 908 */

@link #onStart} when the activity is @link #onCreate} @link #onSaveInstanceState}. @link #onStart} and @link #onPostCreate}. 927 * @param savedInstanceState the data most recently supplied in {@link #onSaveInstanceState}. 929 * @see #onCreate @see #onPostCreate @see #onResume @see #onSaveInstanceState /** 915 * This method is called after {#onStart} when the activity is 916 * being re-initialized from a previously saved state, given here in 917 * savedInstanceState . Most implementations will simply use {#onCreate} 918 * to restore their state, but it is sometimes convenient to do it here 919 * after all of the initialization has been done or to allow subclasses to 920 * decide whether to use your default implementation. The default 921 * implementation of this method performs a restore of any view state that 922 * had previously been frozen by {#onSaveInstanceState}. 923 924 * This method is called between {#onStart} and 925 * {#onPostCreate}. 926 savedInstanceState the data most recently supplied in {#onSaveInstanceState}. 928 #onCreate 930 #onPostCreate 931 #onResume 932 #onSaveInstanceState 933 */

946 * @param savedInstanceState The bundle to restore from. /** 944 * Restore the state of any saved managed dialogs. 945 savedInstanceState The bundle to restore from. 947 */

0

// Calling onRestoreInstanceState() below will invoke dispatchOnCreate

// so tell createDialog() not to do it, otherwise we get an exception

@link #onStart} @link #onRestoreInstanceState} have been called). Applications will 1002 * @param savedInstanceState If the activity is being re-initialized after @link #onSaveInstanceState}. <b><i>Note: Otherwise it is null.</i></b> @see #onCreate /** 993 * Called when activity start-up is complete (after {#onStart} 994 * and {#onRestoreInstanceState} have been called). Applications will 995 * generally not implement this method; it is intended for system 996 * classes to do final initialization after application code has run. 997 998 * Derived classes must call through to the super class's 999 * implementation of this method. If they do not, an exception will be 1000 * thrown. 1001 savedInstanceState If the activity is being re-initialized after 1003 * previously being shut down then this Bundle contains the data it most 1004 * recently supplied in {#onSaveInstanceState}. Note: Otherwise it is null. 1005 #onCreate 1006 */

@link #onCreate} — or after {@link #onRestart} when @link #onResume}. 1024 * @see #onCreate @see #onStop @see #onResume /** 1016 * Called after {#onCreate} — or after {#onRestart} when 1017 * the activity had been stopped, but is now again being displayed to the 1018 * user. It will be followed by {#onResume}. 1019 1020 * Derived classes must call through to the super class's 1021 * implementation of this method. If they do not, an exception will be 1022 * thrown. 1023 #onCreate 1025 #onStop 1026 #onResume 1027 */

"onStart "

@link #onStop} when the current activity is being @link #onStart} and then {@link #onResume}. @link Cursor} objects (instead of @link #managedQuery(android.net.Uri , String[], String, String[], String)}, @link #onStop}. 1061 * @see #onStop @see #onStart @see #onResume /** 1046 * Called after {#onStop} when the current activity is being 1047 * re-displayed to the user (the user has navigated back to it). It will 1048 * be followed by {#onStart} and then {#onResume}. 1049 1050 * For activities that are using raw {Cursor} objects (instead of 1051 * creating them through 1052 * {#managedQuery(android.net.Uri , String[], String, String[], String)}, 1053 * this is usually the place 1054 * where the cursor should be requeried (because you had deactivated it in 1055 * {#onStop}. 1056 1057 * Derived classes must call through to the super class's 1058 * implementation of this method. If they do not, an exception will be 1059 * thrown. 1060 #onStop 1062 #onStart 1063 #onResume 1064 */

@link #onRestoreInstanceState}, {@link #onRestart}, or @link #onPause}, for your activity to start interacting with the user. @link #onWindowFocusChanged} to know for certain that your 1084 * @see #onRestoreInstanceState @see #onRestart @see #onPostResume @see #onPause /** 1070 * Called after {#onRestoreInstanceState}, {#onRestart}, or 1071 * {#onPause}, for your activity to start interacting with the user. 1072 * This is a good place to begin animations, open exclusive-access devices 1073 * (such as the camera), etc. 1074 1075 * Keep in mind that onResume is not the best indicator that your activity 1076 * is visible to the user; a system window such as the keyguard may be in 1077 * front. Use {#onWindowFocusChanged} to know for certain that your 1078 * activity is visible to the user (for example, to resume a game). 1079 1080 * Derived classes must call through to the super class's 1081 * implementation of this method. If they do not, an exception will be 1082 * thrown. 1083 #onRestoreInstanceState 1085 #onRestart 1086 #onPostResume 1087 #onPause 1088 */

"onResume "

@link #onResume} has 1105 * @see #onResume /** 1096 * Called when activity resume is complete (after {#onResume} has 1097 * been called). Applications will generally not implement this method; 1098 * it is intended for system classes to do final setup after application 1099 * resume code has run. 1100 1101 * Derived classes must call through to the super class's 1102 * implementation of this method. If they do not, an exception will be 1103 * thrown. 1104 #onResume 1106 */

@link Intent#FLAG_ACTIVITY_SINGLE_TOP} @link #startActivity}. In either case, when the @link #onResume} being called after this method. @link #getIntent} still returns the original Intent. You @link #setIntent} to update it to this new Intent. 1129 * @param intent The new intent that was started for the activity. 1131 * @see #getIntent @see #setIntent @see #onResume /** 1115 * This is called for activities that set launchMode to "singleTop" in 1116 * their package, or if a client used the {Intent#FLAG_ACTIVITY_SINGLE_TOP} 1117 * flag when calling {#startActivity}. In either case, when the 1118 * activity is re-launched while at the top of the activity stack instead 1119 * of a new instance of the activity being started, onNewIntent() will be 1120 * called on the existing instance with the Intent that was used to 1121 * re-launch it. 1122 1123 * An activity will always be paused before receiving a new intent, so 1124 * you can count on {#onResume} being called after this method. 1125 1126 * Note that {#getIntent} still returns the original Intent. You 1127 * can use {#setIntent} to update it to this new Intent. 1128 intent The new intent that was started for the activity. 1130 #getIntent 1132 #setIntent 1133 #onResume 1134 */

@link ActivityThread} to save the state of this activity. @link #onSaveInstanceState(android.os.Bundle)} @link #saveManagedDialogs(android.os.Bundle)}. 1144 * @param outState The bundle to save the state to. /** 1139 * The hook for {ActivityThread} to save the state of this activity. 1140 1141 * Calls {#onSaveInstanceState(android.os.Bundle)} 1142 * and {#saveManagedDialogs(android.os.Bundle)}. 1143 outState The bundle to save the state to. 1145 */

"onSaveInstanceState "

": "

@link #onCreate} or @link #onRestoreInstanceState} (the {@link Bundle} populated by this method @link #onCreate} or {@link #onRestoreInstanceState}. @link #onPause}, which is always called when an activity is being placed @link #onStop} which @link #onPause} and @link #onStop} is called and not this method is when a user navigates back @link #onSaveInstanceState} @link #onPause} is called and @link #onSaveInstanceState} is when activity B is launched in front of activity A: @link #onSaveInstanceState} on activity A if it isn't @link android.view.View#onSaveInstanceState()} on each @link #onRestoreInstanceState}). If you override this method to save additional @link #onStop}. There are @link #onPause}. 1191 * @param outState Bundle in which to place your saved state. 1193 * @see #onCreate @see #onRestoreInstanceState @see #onPause /** 1153 * Called to retrieve per-instance state from an activity before being killed 1154 * so that the state can be restored in {#onCreate} or 1155 * {#onRestoreInstanceState} (the {Bundle} populated by this method 1156 * will be passed to both). 1157 1158 * This method is called before an activity may be killed so that when it 1159 * comes back some time in the future it can restore its state. For example, 1160 * if activity B is launched in front of activity A, and at some point activity 1161 * A is killed to reclaim resources, activity A will have a chance to save the 1162 * current state of its user interface via this method so that when the user 1163 * returns to activity A, the state of the user interface can be restored 1164 * via {#onCreate} or {#onRestoreInstanceState}. 1165 1166 * Do not confuse this method with activity lifecycle callbacks such as 1167 * {#onPause}, which is always called when an activity is being placed 1168 * in the background or on its way to destruction, or {#onStop} which 1169 * is called before destruction. One example of when {#onPause} and 1170 * {#onStop} is called and not this method is when a user navigates back 1171 * from activity B to activity A: there is no need to call {#onSaveInstanceState} 1172 * on B because that particular instance will never be restored, so the 1173 * system avoids calling it. An example when {#onPause} is called and 1174 * not {#onSaveInstanceState} is when activity B is launched in front of activity A: 1175 * the system may avoid calling {#onSaveInstanceState} on activity A if it isn't 1176 * killed during the lifetime of B since the state of the user interface of 1177 * A will stay intact. 1178 1179 * The default implementation takes care of most of the UI per-instance 1180 * state for you by calling {android.view.View#onSaveInstanceState()} on each 1181 * view in the hierarchy that has an id, and by saving the id of the currently 1182 * focused view (all of which is restored by the default implementation of 1183 * {#onRestoreInstanceState}). If you override this method to save additional 1184 * information not captured by each individual view, you will likely want to 1185 * call through to the default implementation, otherwise be prepared to save 1186 * all of the state of each view yourself. 1187 1188 * If called, this method will occur before {#onStop}. There are 1189 * no guarantees about whether it will occur before or after {#onPause}. 1190 outState Bundle in which to place your saved state. 1192 #onCreate 1194 #onRestoreInstanceState 1195 #onPause 1196 */

1209 * @param outState place to store the saved state. /** 1207 * Save the state of any managed dialogs. 1208 outState place to store the saved state. 1210 */

0

// save each dialog's bundle, gather the ids

0

@link #onResume}. @link #onPause} returns, @link #onSaveInstanceState} is used to save @link #onStop} (after the next activity has been resumed and @link #onResume} without going through the stopped state. 1275 * @see #onResume @see #onSaveInstanceState @see #onStop /** 1242 * Called as part of the activity lifecycle when an activity is going into 1243 * the background, but has not (yet) been killed. The counterpart to 1244 * {#onResume}. 1245 1246 * When activity B is launched in front of activity A, this callback will 1247 * be invoked on A. B will not be created until A's {#onPause} returns, 1248 * so be sure to not do anything lengthy here. 1249 1250 * This callback is mostly used for saving any persistent state the 1251 * activity is editing, to present a "edit in place" model to the user and 1252 * making sure nothing is lost if there are not enough resources to start 1253 * the new activity without first killing this one. This is also a good 1254 * place to do things like stop animations and other things that consume a 1255 * noticeable amount of CPU in order to make the switch to the next activity 1256 * as fast as possible, or to close resources that are exclusive access 1257 * such as the camera. 1258 1259 * In situations where the system needs more memory it may kill paused 1260 * processes to reclaim resources. Because of this, you should be sure 1261 * that all of your state is saved by the time you return from 1262 * this function. In general {#onSaveInstanceState} is used to save 1263 * per-instance state in the activity and this method is used to store 1264 * global persistent data (in content providers, files, etc.) 1265 1266 * After receiving this call you will usually receive a following call 1267 * to {#onStop} (after the next activity has been resumed and 1268 * displayed), however in some cases there will be a direct call back to 1269 * {#onResume} without going through the stopped state. 1270 1271 * Derived classes must call through to the super class's 1272 * implementation of this method. If they do not, an exception will be 1273 * thrown. 1274 #onResume 1276 #onSaveInstanceState 1277 #onStop 1278 */

"onPause "

@link #onUserLeaveHint} will be called, but @link #onUserLeaveHint} will not be called on @link #onPause} callback. @link #onUserInteraction} are intended to help 1298 * @see #onUserInteraction() /** 1286 * Called as part of the activity lifecycle when an activity is about to go 1287 * into the background as the result of user choice. For example, when the 1288 * user presses the Home key, {#onUserLeaveHint} will be called, but 1289 * when an incoming phone call causes the in-call Activity to be automatically 1290 * brought to the foreground, {#onUserLeaveHint} will not be called on 1291 * the activity being interrupted. In cases when it is invoked, this method 1292 * is called right before the activity's {#onPause} callback. 1293 1294 * This callback and {#onUserInteraction} are intended to help 1295 * activities manage status bar notifications intelligently; specifically, 1296 * for helping activities determine the proper time to cancel a notfication. 1297 #onUserInteraction() 1299 */

1313 * @param outBitmap The bitmap to contain the thumbnail. @param canvas Can be used to render into the bitmap. 1316 * @return Return true if you have drawn into the bitmap; otherwise after 1319 * @see #onCreateDescription @see #onSaveInstanceState @see #onPause /** 1304 * Generate a new thumbnail for this activity. This method is called before 1305 * pausing the activity, and should draw into outBitmap the 1306 * imagery for the desired thumbnail in the dimensions of that bitmap. It 1307 * can use the given canvas , which is configured to draw into the 1308 * bitmap, for rendering if desired. 1309 1310 * The default implementation returns fails and does not draw a thumbnail; 1311 * this will result in the platform creating its own thumbnail if needed. 1312 outBitmap The bitmap to contain the thumbnail. 1314 canvas Can be used to render into the bitmap. 1315 Return true if you have drawn into the bitmap; otherwise after 1317 * you return it will be filled with a default thumbnail. 1318 #onCreateDescription 1320 #onSaveInstanceState 1321 #onPause 1322 */

1337 * @return A description of what the user is doing. It should be short and 1340 * @see #onCreateThumbnail @see #onSaveInstanceState @see #onPause /** 1328 * Generate a new description for this activity. This method is called 1329 * before pausing the activity and can, if desired, return some textual 1330 * description of its current state to be displayed to the user. 1331 1332 * The default implementation returns null, which will cause you to 1333 * inherit the description from the previous activity. If all activities 1334 * return null, generally the label of the top activity will be used as the 1335 * description. 1336 A description of what the user is doing. It should be short and 1338 * sweet (only a few words). 1339 #onCreateThumbnail 1341 #onSaveInstanceState 1342 #onPause 1343 */

@link #onRestart}, {@link #onDestroy}, or nothing, @link #onPause} method is called. 1361 * @see #onRestart @see #onResume @see #onSaveInstanceState @see #onDestroy /** 1349 * Called when you are no longer visible to the user. You will next 1350 * receive either {#onRestart}, {#onDestroy}, or nothing, 1351 * depending on later user activity. 1352 1353 * Note that this method may never be called, in low memory situations 1354 * where the system does not have enough memory to keep your activity's 1355 * process running after its {#onPause} method is called. 1356 1357 * Derived classes must call through to the super class's 1358 * implementation of this method. If they do not, an exception will be 1359 * thrown. 1360 #onRestart 1362 #onResume 1363 #onSaveInstanceState 1364 #onDestroy 1365 */

"onStop "

@link #finish} on it, or because the system is temporarily destroying @link #isFinishing} method. @link #onPause} or @link #onSaveInstanceState}, not here.</em> This method is usually implemented to 1396 * @see #onPause @see #onStop @see #finish @see #isFinishing /** 1374 * Perform any final cleanup before an activity is destroyed. This can 1375 * happen either because the activity is finishing (someone called 1376 * {#finish} on it, or because the system is temporarily destroying 1377 * this instance of the activity to save space. You can distinguish 1378 * between these two scenarios with the {#isFinishing} method. 1379 1380 * Note: do not count on this method being called as a place for 1381 * saving data! For example, if an activity is editing data in a content 1382 * provider, those edits should be committed in either {#onPause} or 1383 * {#onSaveInstanceState}, not here. This method is usually implemented to 1384 * free resources like threads that are associated with an activity, so 1385 * that a destroyed activity does not leave such things around while the 1386 * rest of its application is still running. There are situations where 1387 * the system will simply kill the activity's hosting process without 1388 * calling this method (or any others) in it, so it should not be used to 1389 * do things that are intended to remain around after the process goes 1390 * away. 1391 1392 * Derived classes must call through to the super class's 1393 * implementation of this method. If they do not, an exception will be 1394 * thrown. 1395 #onPause 1397 #onStop 1398 #finish 1399 #isFinishing 1400 */

"onDestroy "

// dismiss any dialogs we are managing.

0

// close any cursors we are managing.

0

// Close any open search dialog

@link android.R.attr#configChanges} attribute in your manifest. If 1451 * @param newConfig The new device configuration. /** 1438 * Called by the system when the device configuration changes while your 1439 * activity is running. Note that this will only be called if 1440 * you have selected configurations you would like to handle with the 1441 * {android.R.attr#configChanges} attribute in your manifest. If 1442 * any configuration change occurs that is not selected to be reported 1443 * by that attribute, then instead of reporting it the system will stop 1444 * and restart the activity (to have it launched with the new 1445 * configuration). 1446 1447 * At the time that this function has been called, your Resources 1448 * object will have been updated to return resource values matching the 1449 * new configuration. 1450 newConfig The new device configuration. 1452 */

"onConfigurationChanged "

": "

// Pass the configuration changed event to the window

// Do this last; the action bar will need to access

// view changes from above.

@link #onConfigurationChanged(Configuration)} method is 1481 * @return Returns a bit field of the configuration parameters that are @link /** 1472 * If this activity is being destroyed because it can not handle a 1473 * configuration parameter being changed (and thus its 1474 * {#onConfigurationChanged(Configuration)} method is 1475 * not being called), then you can use this method to discover 1476 * the set of changes that have occurred while in the process of being 1477 * destroyed. Note that there is no guarantee that these will be 1478 * accurate (other changes could have happened at any time), so you should 1479 * only use this as an optimization hint. 1480 Returns a bit field of the configuration parameters that are 1482 * changing, as defined by the { android.content.res.Conf iguration} 1483 * class. 1484 */

@link #onRetainNonConfigurationInstance()}. This will @link #onCreate} and @link #onStart} calls to the new instance, allowing you to extract @link #onSaveInstanceState(Bundle)} mechanism) even if this 1503 * @return Returns the object previously returned by @link #onRetainNonConfigurationInstance()}. 1506 * @deprecated Use the new {@link Fragment} API @link Fragment#setRetainInstance(boolean)} instead; this is also /** 1490 * Retrieve the non-configuration instance data that was previously 1491 * returned by {#onRetainNonConfigurationInstance()}. This will 1492 * be available from the initial {#onCreate} and 1493 * {#onStart} calls to the new instance, allowing you to extract 1494 * any useful dynamic state from the previous instance. 1495 1496 * Note that the data you retrieve here should only be used 1497 * as an optimization for handling configuration changes. You should always 1498 * be able to handle getting a null pointer back, and an activity must 1499 * still be able to restore itself to its previous state (through the 1500 * normal {#onSaveInstanceState(Bundle)} mechanism) even if this 1501 * function returns null. 1502 Returns the object previously returned by 1504 * {#onRetainNonConfigurationInstance()}. 1505 Use the new {Fragment} API 1507 * {Fragment#setRetainInstance(boolean)} instead; this is also 1508 * available on older platforms through the Android compatibility package. 1509 */

@link #getLastNonConfigurationInstance()} in the new activity @link android.os.Build.VERSION_CODES#HONEYCOMB} @link Fragment} with @link Fragment#setRetainInstance(boolean) @link #onStop} and @link #onDestroy}. @link #onDestroy()} is called. In particular, @link #getLastNonConfigurationInstance()} method of the following @link android.os.AsyncTask} you are guaranteed that its @link android.os.AsyncTask#onPostExecute}) will @link #onCreate(Bundle)}. (Note however that there is of course no such @link android.os.AsyncTask#doInBackground} since that is 1561 * @return Return any Object holding the desired state to propagate to the 1564 * @deprecated Use the new {@link Fragment} API @link Fragment#setRetainInstance(boolean)} instead; this is also /** 1517 * Called by the system, as part of destroying an 1518 * activity due to a configuration change, when it is known that a new 1519 * instance will immediately be created for the new configuration. You 1520 * can return any object you like here, including the activity instance 1521 * itself, which can later be retrieved by calling 1522 * {#getLastNonConfigurationInstance()} in the new activity 1523 * instance. 1524 1525 * If you are targeting {android.os.Build.VERSION_CODES#HONEYCOMB} 1526 * or later, consider instead using a {Fragment} with 1527 * {Fragment#setRetainInstance(boolean) 1528 * Fragment.setRetainInstance(boolean}. 1529 1530 * This function is called purely as an optimization, and you must 1531 * not rely on it being called. When it is called, a number of guarantees 1532 * will be made to help optimize configuration switching: 1533 * 1534 * The function will be called between {#onStop} and 1535 * {#onDestroy}. 1536 *

A new instance of the activity will always be immediately 1537 * created after this one's {#onDestroy()} is called. In particular, 1538 * no messages will be dispatched during this time (when the returned 1539 * object does not have an activity to be associated with). 1540 *

be immediately 1537 * created after this one's {#onDestroy()} is called. In particular, 1538 * messages will be dispatched during this time (when the returned 1539 * object does not have an activity to be associated with). 1540 * The object you return here will always be available from 1541 * the {#getLastNonConfigurationInstance()} method of the following 1542 * activity instance as described there. 1543 * 1544 1545 * These guarantees are designed so that an activity can use this API 1546 * to propagate extensive state from the old to new activity instance, from 1547 * loaded bitmaps, to network connections, to evenly actively running 1548 * threads. Note that you should not propagate any data that 1549 * may change based on the configuration, including any data loaded from 1550 * resources such as strings, layouts, or drawables. 1551 1552 * The guarantee of no message handling during the switch to the next 1553 * activity simplifies use with active objects. For example if your retained 1554 * state is an {android.os.AsyncTask} you are guaranteed that its 1555 * call back functions (like {android.os.AsyncTask#onPostExecute}) will 1556 * not be called from the call here until you execute the next instance's 1557 * {#onCreate(Bundle)}. (Note however that there is of course no such 1558 * guarantee for {android.os.AsyncTask#doInBackground} since that is 1559 * running in a separate thread.) 1560 Return any Object holding the desired state to propagate to the 1562 * next activity instance. 1563 Use the new {Fragment} API 1565 * {Fragment#setRetainInstance(boolean)} instead; this is also 1566 * available on older platforms through the Android compatibility package. 1567 */

@link #onRetainNonConfigurationChildInstances()}. This will @link #onCreate} and @link #onStart} calls to the new instance, allowing you to extract @link #onSaveInstanceState(Bundle)} mechanism) even if this 1586 * @return Returns the object previously returned by @link #onRetainNonConfigurationChildInstances()} /** 1573 * Retrieve the non-configuration instance data that was previously 1574 * returned by {#onRetainNonConfigurationChildInstances()}. This will 1575 * be available from the initial {#onCreate} and 1576 * {#onStart} calls to the new instance, allowing you to extract 1577 * any useful dynamic state from the previous instance. 1578 1579 * Note that the data you retrieve here should only be used 1580 * as an optimization for handling configuration changes. You should always 1581 * be able to handle getting a null pointer back, and an activity must 1582 * still be able to restore itself to its previous state (through the 1583 * normal {#onSaveInstanceState(Bundle)} mechanism) even if this 1584 * function returns null. 1585 Returns the object previously returned by 1587 * {#onRetainNonConfigurationChildInstances()} 1588 */

@link #onRetainNonConfigurationInstance()} except that @link #onRetainNonConfigurationInstance()}. The default implementation returns null. /** 1595 * This method is similar to {#onRetainNonConfigurationInstance()} except that 1596 * it should return either a mapping from child activity id strings to arbitrary objects, 1597 * or null. This method is intended to be used by Activity framework subclasses that control a 1598 * set of child activities, such as ActivityGroup. The same guarantees and restrictions apply 1599 * as for {#onRetainNonConfigurationInstance()}. The default implementation returns null. 1600 */

// prune out any loader managers that were already stopped and so

// have nothing useful to retain.

0

"onLowMemory "

"onTrimMemory "

": "

/** 1652 * Return the FragmentManager for interacting with fragments associated 1653 * with this activity. 1654 */

//Log.v(TAG, "invalidateFragmentIndex: index=" + index);

@link Fragment#onAttach Fragment.onAttach()} @link Fragment#onCreate Fragment.onCreate()}. /** 1671 * Called when a Fragment is being attached to this activity, immediately 1672 * after the call to its {Fragment#onAttach Fragment.onAttach()} 1673 * method and before {Fragment#onCreate Fragment.onCreate()}. 1674 */

@link ContentResolver#query(android.net.Uri , String[], String, String[], String)} @link Cursor} to call @link #startManagingCursor} so that the activity will manage its @link android.os.Build.VERSION_CODES#HONEYCOMB} @link LoaderManager} instead, available @link #getLoaderManager()}.</em> @link Cursor#close()} on a cursor obtained using @link #stopManagingCursor} on a cursor from a managed query, the system <em>will @link Cursor#close()}.</p> 1695 * @param uri The URI of the content provider to query. @param projection List of columns to return. @param selection SQL WHERE clause. @param sortOrder SQL ORDER BY clause. 1700 * @return The Cursor that was returned by query(). 1702 * @see ContentResolver#query(android.net.Uri , String[], String, String[], String) @see #startManagingCursor @hide 1705 * 1706 * @deprecated Use {@link CursorLoader} instead. /** 1679 * Wrapper around 1680 * {ContentResolver#query(android.net.Uri , String[], String, String[], String)} 1681 * that gives the resulting {Cursor} to call 1682 * {#startManagingCursor} so that the activity will manage its 1683 * lifecycle for you. 1684 1685 * If you are targeting {android.os.Build.VERSION_CODES#HONEYCOMB} 1686 * or later, consider instead using {LoaderManager} instead, available 1687 * via {#getLoaderManager()}. 1688 1689 * Warning: Do not call {Cursor#close()} on a cursor obtained using 1690 * this method, because the activity will do that for you at the appropriate time. However, if 1691 * you call {#stopManagingCursor} on a cursor from a managed query, the system will 1692 * not automatically close the cursor and, in that case, you must call 1693 * {Cursor#close()}. 1694 uri The URI of the content provider to query. 1696 projection List of columns to return. 1697 selection SQL WHERE clause. 1698 sortOrder SQL ORDER BY clause. 1699 The Cursor that was returned by query(). 1701 ContentResolver#query(android.net.Uri , String[], String, String[], String) 1703 #startManagingCursor 1704 Use {CursorLoader} instead. 1707 */

@link ContentResolver#query(android.net.Uri , String[], String, String[], String)} @link Cursor} to call @link #startManagingCursor} so that the activity will manage its @link android.os.Build.VERSION_CODES#HONEYCOMB} @link LoaderManager} instead, available @link #getLoaderManager()}.</em> @link Cursor#close()} on a cursor obtained using @link #stopManagingCursor} on a cursor from a managed query, the system <em>will @link Cursor#close()}.</p> 1735 * @param uri The URI of the content provider to query. @param projection List of columns to return. @param selection SQL WHERE clause. @param selectionArgs The arguments to selection, if any ?s are pesent @param sortOrder SQL ORDER BY clause. 1741 * @return The Cursor that was returned by query(). 1743 * @see ContentResolver#query(android.net.Uri , String[], String, String[], String) @see #startManagingCursor 1746 * @deprecated Use {@link CursorLoader} instead. /** 1719 * Wrapper around 1720 * {ContentResolver#query(android.net.Uri , String[], String, String[], String)} 1721 * that gives the resulting {Cursor} to call 1722 * {#startManagingCursor} so that the activity will manage its 1723 * lifecycle for you. 1724 1725 * If you are targeting {android.os.Build.VERSION_CODES#HONEYCOMB} 1726 * or later, consider instead using {LoaderManager} instead, available 1727 * via {#getLoaderManager()}. 1728 1729 * Warning: Do not call {Cursor#close()} on a cursor obtained using 1730 * this method, because the activity will do that for you at the appropriate time. However, if 1731 * you call {#stopManagingCursor} on a cursor from a managed query, the system will 1732 * not automatically close the cursor and, in that case, you must call 1733 * {Cursor#close()}. 1734 uri The URI of the content provider to query. 1736 projection List of columns to return. 1737 selection SQL WHERE clause. 1738 selectionArgs The arguments to selection, if any ?s are pesent 1739 sortOrder SQL ORDER BY clause. 1740 The Cursor that was returned by query(). 1742 ContentResolver#query(android.net.Uri , String[], String, String[], String) 1744 #startManagingCursor 1745 Use {CursorLoader} instead. 1747 */

@link Cursor}'s lifecycle for you based on the activity's lifecycle. @link Cursor#deactivate} on the given Cursor, and when it is later restarted @link Cursor#requery} for you. When the activity is @link android.os.Build.VERSION_CODES#HONEYCOMB} @link LoaderManager} instead, available @link #getLoaderManager()}.</em> @link Cursor#close()} on cursor obtained from @link #managedQuery}, because the activity will do that for you at the appropriate time. @link #stopManagingCursor} on a cursor from a managed query, the system @link Cursor#close()}.</p> 1776 * @param c The Cursor to be managed. 1778 * @see #managedQuery(android.net.Uri , String[], String, String[], String) @see #stopManagingCursor 1781 * @deprecated Use the new {@link android.content.CursorLoader} class with @link LoaderManager} instead; this is also /** 1759 * This method allows the activity to take care of managing the given 1760 * {Cursor}'s lifecycle for you based on the activity's lifecycle. 1761 * That is, when the activity is stopped it will automatically call 1762 * {Cursor#deactivate} on the given Cursor, and when it is later restarted 1763 * it will call {Cursor#requery} for you. When the activity is 1764 * destroyed, all managed Cursors will be closed automatically. 1765 1766 * If you are targeting {android.os.Build.VERSION_CODES#HONEYCOMB} 1767 * or later, consider instead using {LoaderManager} instead, available 1768 * via {#getLoaderManager()}. 1769 1770 * Warning: Do not call {Cursor#close()} on cursor obtained from 1771 * {#managedQuery}, because the activity will do that for you at the appropriate time. 1772 * However, if you call {#stopManagingCursor} on a cursor from a managed query, the system 1773 * will not automatically close the cursor and, in that case, you must call 1774 * {Cursor#close()}. 1775 c The Cursor to be managed. 1777 #managedQuery(android.net.Uri , String[], String, String[], String) 1779 #stopManagingCursor 1780 Use the new {android.content.CursorLoader} class with 1782 * {LoaderManager} instead; this is also 1783 * available on older platforms through the Android compatibility package. 1784 */

@link #startManagingCursor}, stop the activity's management of that @link Cursor#close()}.</p> 1801 * @param c The Cursor that was being managed. 1803 * @see #startManagingCursor 1805 * @deprecated Use the new {@link android.content.CursorLoader} class with @link LoaderManager} instead; this is also /** 1793 * Given a Cursor that was previously given to 1794 * {#startManagingCursor}, stop the activity's management of that 1795 * cursor. 1796 1797 * Warning: After calling this method on a cursor from a managed query, 1798 * the system will not automatically close the cursor and you must call 1799 * {Cursor#close()}. 1800 c The Cursor that was being managed. 1802 #startManagingCursor 1804 Use the new {android.content.CursorLoader} class with 1806 * {LoaderManager} instead; this is also 1807 * available on older platforms through the Android compatibility package. 1808 */

0

@deprecated As of {@link android.os.Build.VERSION_CODES#GINGERBREAD} @hide /** 1824 As of {android.os.Build.VERSION_CODES#GINGERBREAD} 1825 * this is a no-op. 1826 1827 */

@link #onCreate}. 1836 * @return The view if found or null otherwise. /** 1833 * Finds a view that was identified by the id attribute from the XML that 1834 * was processed in {#onCreate}. 1835 The view if found or null otherwise. 1837 */

1845 * @return The Activity's ActionBar, or null if it does not have one. /** 1843 * Retrieve a reference to this activity's ActionBar. 1844 The Activity's ActionBar, or null if it does not have one. 1846 */

/** 1853 * Creates a new ActionBar, locates the inflated ActionBarView, 1854 * initializes the ActionBar with the view, and sets mActionBar. 1855 */

// Initializing the window decor can change window feature flags.

// Make sure that we have the correct set before performing the test below.

1875 * @param layoutResID Resource ID to be inflated. 1877 * @see #setContentView(android.view.View) @see #setContentView(android.view.View, android.view.ViewGroup.LayoutParams) /** 1872 * Set the activity content from a layout resource. The resource will be 1873 * inflated, adding all top-level views to the activity. 1874 layoutResID Resource ID to be inflated. 1876 #setContentView(android.view.View) 1878 #setContentView(android.view.View, android.view.ViewGroup.LayoutParams) 1879 */

@link ViewGroup.LayoutParams#MATCH_PARENT}. To use @link #setContentView(android.view.View, android.view.ViewGroup.LayoutParams)} 1895 * @param view The desired content to display. 1897 * @see #setContentView(int) @see #setContentView(android.view.View, android.view.ViewGroup.LayoutParams) /** 1886 * Set the activity content to an explicit view. This view is placed 1887 * directly into the activity's view hierarchy. It can itself be a complex 1888 * view hierarchy. When calling this method, the layout parameters of the 1889 * specified view are ignored. Both the width and the height of the view are 1890 * set by default to {ViewGroup.LayoutParams#MATCH_PARENT}. To use 1891 * your own layout parameters, invoke 1892 * {#setContentView(android.view.View, android.view.ViewGroup.LayoutParams)} 1893 * instead. 1894 view The desired content to display. 1896 #setContentView(int) 1898 #setContentView(android.view.View, android.view.ViewGroup.LayoutParams) 1899 */

1910 * @param view The desired content to display. @param params Layout parameters for the view. 1913 * @see #setContentView(android.view.View) @see #setContentView(int) /** 1906 * Set the activity content to an explicit view. This view is placed 1907 * directly into the activity's view hierarchy. It can itself be a complex 1908 * view hierarchy. 1909 view The desired content to display. 1911 params Layout parameters for the view. 1912 #setContentView(android.view.View) 1914 #setContentView(int) 1915 */

1925 * @param view The desired content to display. @param params Layout parameters for the view. /** 1922 * Add an additional content view to the activity. Added after any existing 1923 * ones in the activity -- existing views are NOT removed. 1924 view The desired content to display. 1926 params Layout parameters for the view. 1927 */

/** 1934 * Sets whether this activity is finished when touched outside its window's 1935 * bounds. 1936 */

@link #setDefaultKeyMode} to turn off default handling of 1945 * @see #setDefaultKeyMode /** 1942 * Use with {#setDefaultKeyMode} to turn off default handling of 1943 * keys. 1944 #setDefaultKeyMode 1946 */

0

@link #setDefaultKeyMode} to launch the dialer during default 1952 * @see #setDefaultKeyMode /** 1949 * Use with {#setDefaultKeyMode} to launch the dialer during default 1950 * key handling. 1951 #setDefaultKeyMode 1953 */

1

@link #setDefaultKeyMode} to execute a menu shortcut in 1961 * @see #setDefaultKeyMode /** 1956 * Use with {#setDefaultKeyMode} to execute a menu shortcut in 1957 * default key handling. 1958 1959 * That is, the user does not need to hold down the menu key to execute menu shortcuts. 1960 #setDefaultKeyMode 1962 */

2

@link #setDefaultKeyMode} to specify that unhandled keystrokes @link android.app.SearchManager android.app.SearchManager} for more details. 1971 * @see #setDefaultKeyMode /** 1965 * Use with {#setDefaultKeyMode} to specify that unhandled keystrokes 1966 * will start an application-defined search. (If the application or activity does not 1967 * actually define a search, the the keys will be ignored.) 1968 1969 * See {android.app.SearchManager android.app.SearchManager} for more details. 1970 #setDefaultKeyMode 1972 */

3

@link #setDefaultKeyMode} to specify that unhandled keystrokes @link android.app.SearchManager android.app.SearchManager} for more details. 1982 * @see #setDefaultKeyMode /** 1976 * Use with {#setDefaultKeyMode} to specify that unhandled keystrokes 1977 * will start a global search (typically web search, but some platforms may define alternate 1978 * methods for global search) 1979 1980 * See {android.app.SearchManager android.app.SearchManager} for more details. 1981 #setDefaultKeyMode 1983 */

4

@link #DEFAULT_KEYS_DISABLE}) will simply drop them on the @link #DEFAULT_KEYS_DIALER}), execute a shortcut in your options @link #DEFAULT_KEYS_SHORTCUT}), or launch a search ({@link #DEFAULT_KEYS_SEARCH_LOCAL} @link #DEFAULT_KEYS_SEARCH_GLOBAL}). 2001 * @param mode The desired default key mode constant. 2003 * @see #DEFAULT_KEYS_DISABLE @see #DEFAULT_KEYS_DIALER @see #DEFAULT_KEYS_SHORTCUT @see #DEFAULT_KEYS_SEARCH_LOCAL @see #DEFAULT_KEYS_SEARCH_GLOBAL @see #onKeyDown /** 1987 * Select the default key handling for this activity. This controls what 1988 * will happen to key events that are not otherwise handled. The default 1989 * mode ({#DEFAULT_KEYS_DISABLE}) will simply drop them on the 1990 * floor. Other modes allow you to launch the dialer 1991 * ({#DEFAULT_KEYS_DIALER}), execute a shortcut in your options 1992 * menu without requiring the menu key be held down 1993 * ({#DEFAULT_KEYS_SHORTCUT}), or launch a search ({#DEFAULT_KEYS_SEARCH_LOCAL} 1994 * and {#DEFAULT_KEYS_SEARCH_GLOBAL}). 1995 1996 * Note that the mode selected here does not impact the default 1997 * handling of system keys, such as the "back" and "menu" keys, and your 1998 * activity and its views always get a first chance to receive and handle 1999 * all application keys. 2000 mode The desired default key mode constant. 2002 #DEFAULT_KEYS_DISABLE 2004 #DEFAULT_KEYS_DIALER 2005 #DEFAULT_KEYS_SHORTCUT 2006 #DEFAULT_KEYS_SEARCH_LOCAL 2007 #DEFAULT_KEYS_SEARCH_GLOBAL 2008 #onKeyDown 2009 */

// Some modes use a SpannableStringBuilder to track & dispatch input events

// This list must remain in sync with the switch in onKeyDown()

// not used in these modes

0

@link KeyEvent#KEYCODE_BACK} @link #onBackPressed()}, though the behavior varies based @link android.os.Build.VERSION_CODES#ECLAIR} or later applications, @link #onKeyUp} where the action @link #setDefaultKeyMode}. 2051 * @return Return <code>true</code> to prevent this event from being propagated @see #onKeyUp @see android.view.KeyEvent /** 2032 * Called when a key was pressed down and not handled by any of the views 2033 * inside of the activity. So, for example, key presses while the cursor 2034 * is inside a TextView will not trigger the event (unless it is a navigation 2035 * to another object) because TextView handles its own key presses. 2036 2037 * If the focused view didn't want this event, this method is called. 2038 2039 * The default implementation takes care of {KeyEvent#KEYCODE_BACK} 2040 * by calling {#onBackPressed()}, though the behavior varies based 2041 * on the application compatibility mode: for 2042 * {android.os.Build.VERSION_CODES#ECLAIR} or later applications, 2043 * it will set up the dispatch to call {#onKeyUp} where the action 2044 * will be performed; for earlier applications, it will perform the 2045 * action immediately in on-down, as those versions of the platform 2046 * behaved. 2047 2048 * Other additional default key handling may be performed 2049 * if configured with {#setDefaultKeyMode}. 2050 Return true to prevent this event from being propagated 2052 * further, or false to indicate that you have not handled 2053 * this event and it should continue to be propagated. 2054 #onKeyUp 2055 android.view.KeyEvent 2056 */

// Common code for DEFAULT_KEYS_DIALER & DEFAULT_KEYS_SEARCH_*

0

0

// something useable has been typed - dispatch it now.

"tel:"

0

@link KeyEvent.Callback#onKeyLongPress(int, KeyEvent) /** 2117 * Default implementation of {KeyEvent.Callback#onKeyLongPress(int, KeyEvent) 2118 * KeyEvent.Callback.onKeyLongPress()}: always returns false (doesn't handle 2119 * the event). 2120 */

2134 * @return Return <code>true</code> to prevent this event from being propagated @see #onKeyDown @see KeyEvent /** 2126 * Called when a key was released and not handled by any of the views 2127 * inside of the activity. So, for example, key presses while the cursor 2128 * is inside a TextView will not trigger the event (unless it is a navigation 2129 * to another object) because TextView handles its own key presses. 2130 2131 * The default implementation handles KEYCODE_BACK to stop the activity 2132 * and go back. 2133 Return true to prevent this event from being propagated 2135 * further, or false to indicate that you have not handled 2136 * this event and it should continue to be propagated. 2137 #onKeyDown 2138 KeyEvent 2139 */

@link KeyEvent.Callback#onKeyMultiple(int, int, KeyEvent) /** 2153 * Default implementation of {KeyEvent.Callback#onKeyMultiple(int, int, KeyEvent) 2154 * KeyEvent.Callback.onKeyMultiple()}: always returns false (doesn't handle 2155 * the event). 2156 */

/** 2162 * Called when the activity has detected the user's press of the back 2163 * key. The default implementation simply finishes the current activity, 2164 * but you can override this to do whatever you want. 2165 */

@link MenuItem#setShortcut(char, char) shortcut} property of menu items. 2178 * @param keyCode The value in event.getKeyCode(). @param event Description of the key event. @return True if the key shortcut was handled. /** 2173 * Called when a key shortcut event is not handled by any of the views in the Activity. 2174 * Override this method to implement global key shortcuts for the Activity. 2175 * Key shortcuts can also be implemented by setting the 2176 * {MenuItem#setShortcut(char, char) shortcut} property of menu items. 2177 keyCode The value in event.getKeyCode(). 2179 event Description of the key event. 2180 True if the key shortcut was handled. 2181 */

2191 * @param event The touch screen event being processed. 2193 * @return Return true if you have consumed the event, false if you haven't. /** 2187 * Called when a touch screen event was not handled by any of the views 2188 * under it. This is most useful to process touch events that happen 2189 * outside of your window bounds, where there is no view to receive it. 2190 event The touch screen event being processed. 2192 Return true if you have consumed the event, false if you haven't. 2194 * The default implementation always returns false. 2195 */

2214 * @param event The trackball event being processed. 2216 * @return Return true if you have consumed the event, false if you haven't. /** 2206 * Called when the trackball was moved and not handled by any of the 2207 * views inside of the activity. So, for example, if the trackball moves 2208 * while focus is on a button, you will receive a call here because 2209 * buttons do not normally do anything with trackball events. The call 2210 * here happens before trackball movements are converted to 2211 * DPAD key events, which then get sent back to the view hierarchy, and 2212 * will be processed at the point for things like focus navigation. 2213 event The trackball event being processed. 2215 Return true if you have consumed the event, false if you haven't. 2217 * The default implementation always returns false. 2218 */

@link MotionEvent#getSource() source} of the motion event specifies @link android.view.InputDevice#SOURCE_CLASS_POINTER} @link View#onGenericMotionEvent(MotionEvent)} for an example of how to 2243 * @param event The generic motion event being processed. 2245 * @return Return true if you have consumed the event, false if you haven't. /** 2224 * Called when a generic motion event was not handled by any of the 2225 * views inside of the activity. 2226 * 2227 * Generic motion events describe joystick movements, mouse hovers, track pad 2228 * touches, scroll wheel movements and other input events. The 2229 * {MotionEvent#getSource() source} of the motion event specifies 2230 * the class of input that was received. Implementations of this method 2231 * must examine the bits in the source before processing the event. 2232 * The following code example shows how this is done. 2233 * 2234 * Generic motion events with source class 2235 * {android.view.InputDevice#SOURCE_CLASS_POINTER} 2236 * are delivered to the view under the pointer. All other generic motion events are 2237 * delivered to the focused view. 2238 * 2239 * See {View#onGenericMotionEvent(MotionEvent)} for an example of how to 2240 * handle this event. 2241 * 2242 event The generic motion event being processed. 2244 Return true if you have consumed the event, false if you haven't. 2246 * The default implementation always returns false. 2247 */

@link #onUserLeaveHint} are intended to help @link #onUserLeaveHint} callback will @link #onUserInteraction}. This 2269 * @see #onUserLeaveHint() /** 2253 * Called whenever a key, touch, or trackball event is dispatched to the 2254 * activity. Implement this method if you wish to know that the user has 2255 * interacted with the device in some way while your activity is running. 2256 * This callback and {#onUserLeaveHint} are intended to help 2257 * activities manage status bar notifications intelligently; specifically, 2258 * for helping activities determine the proper time to cancel a notfication. 2259 2260 * All calls to your activity's {#onUserLeaveHint} callback will 2261 * be accompanied by calls to {#onUserInteraction}. This 2262 * ensures that your activity will be told of relevant user activity such 2263 * as pulling down the notification pane and touching an item there. 2264 2265 * Note that this callback will be invoked for the touch down action 2266 * that begins a touch gesture, but may not be invoked for the touch-moved 2267 * and touch-up actions that follow. 2268 #onUserLeaveHint() 2270 */

// Update window manager if: we have a view, that view is

// attached to its parent (which will be a RootView), and

// this activity is not embedded.

@link Window} of the activity gains or loses @link #onResume}. 2310 * @param hasFocus Whether the window of this activity has focus. 2312 * @see #hasWindowFocus() @see #onResume @see View#onWindowFocusChanged(boolean) /** 2290 * Called when the current {Window} of the activity gains or loses 2291 * focus. This is the best indicator of whether this activity is visible 2292 * to the user. The default implementation clears the key tracking 2293 * state, so should always be called. 2294 2295 * Note that this provides information about global focus state, which 2296 * is managed independently of activity lifecycles. As such, while focus 2297 * changes will generally have some relation to lifecycle changes (an 2298 * activity that is stopped will not generally get window focus), you 2299 * should not rely on any particular order between the callbacks here and 2300 * those in the other lifecycle methods such as {#onResume}. 2301 2302 * As a general rule, however, a resumed activity will have window 2303 * focus... unless it has displayed other dialogs or popups that take 2304 * input focus, in which case the activity itself will not have focus 2305 * when the other windows have it. Likewise, the system may display 2306 * system-level windows (such as the status bar notification panel or 2307 * a system alert) which will temporarily take window input focus without 2308 * pausing the foreground activity. 2309 hasFocus Whether the window of this activity has focus. 2311 #hasWindowFocus() 2313 #onResume 2314 View#onWindowFocusChanged(boolean) 2315 */

@link View#onAttachedToWindow() View.onAttachedToWindow()} @see View#onAttachedToWindow /** 2320 * Called when the main window associated with the activity has been 2321 * attached to the window manager. 2322 * See {View#onAttachedToWindow() View.onAttachedToWindow()} 2323 * for more information. 2324 View#onAttachedToWindow 2325 */

@link View#onDetachedFromWindow() View.onDetachedFromWindow()} @see View#onDetachedFromWindow /** 2330 * Called when the main window associated with the activity has been 2331 * detached from the window manager. 2332 * See {View#onDetachedFromWindow() View.onDetachedFromWindow()} 2333 * for more information. 2334 View#onDetachedFromWindow 2335 */

2343 * @return True if this activity's main window currently has window focus. 2345 * @see #onWindowAttributesChanged(android.view.WindowManager.LayoutParams) /** 2340 * Returns true if this activity's main window currently has window focus. 2341 * Note that this is not the same as the view itself having focus. 2342 True if this activity's main window currently has window focus. 2344 #onWindowAttributesChanged(android.view.WindowManager.LayoutParams) 2346 */

2363 * @param event The key event. 2365 * @return boolean Return true if this event was consumed. /** 2359 * Called to process key events. You can override this to intercept all 2360 * key events before they are dispatched to the window. Be sure to call 2361 * this implementation for key events that should be handled normally. 2362 event The key event. 2364 boolean Return true if this event was consumed. 2366 */

2385 * @param event The key shortcut event. @return True if this event was consumed. /** 2380 * Called to process a key shortcut event. 2381 * You can override this to intercept all key shortcut events before they are 2382 * dispatched to the window. Be sure to call this implementation for key shortcut 2383 * events that should be handled normally. 2384 event The key shortcut event. 2386 True if this event was consumed. 2387 */

2402 * @param ev The touch screen event. 2404 * @return boolean Return true if this event was consumed. /** 2397 * Called to process touch screen events. You can override this to 2398 * intercept all touch screen events before they are dispatched to the 2399 * window. Be sure to call this implementation for touch screen events 2400 * that should be handled normally. 2401 ev The touch screen event. 2403 boolean Return true if this event was consumed. 2405 */

2422 * @param ev The trackball event. 2424 * @return boolean Return true if this event was consumed. /** 2417 * Called to process trackball events. You can override this to 2418 * intercept all trackball events before they are dispatched to the 2419 * window. Be sure to call this implementation for trackball events 2420 * that should be handled normally. 2421 ev The trackball event. 2423 boolean Return true if this event was consumed. 2425 */

2440 * @param ev The generic motion event. 2442 * @return boolean Return true if this event was consumed. /** 2435 * Called to process generic motion events. You can override this to 2436 * intercept all generic motion events before they are dispatched to the 2437 * window. Be sure to call this implementation for generic motion events 2438 * that should be handled normally. 2439 ev The generic motion event. 2441 boolean Return true if this event was consumed. 2443 */

@link android.view.Window.Callback#onCreatePanelView} /** 2470 * Default implementation of 2471 * {android.view.Window.Callback#onCreatePanelView} 2472 * for activities. This 2473 * simply returns null so that all panel sub-windows will have the default 2474 * menu behavior. 2475 */

@link android.view.Window.Callback#onCreatePanelMenu} @link #onCreateOptionsMenu} method for the @link android.view.Window#FEATURE_OPTIONS_PANEL} panel, /** 2481 * Default implementation of 2482 * {android.view.Window.Callback#onCreatePanelMenu} 2483 * for activities. This calls through to the new 2484 * {#onCreateOptionsMenu} method for the 2485 * {android.view.Window#FEATURE_OPTIONS_PANEL} panel, 2486 * so that subclasses of Activity don't need to deal with feature codes. 2487 */

@link android.view.Window.Callback#onPreparePanel} @link #onPrepareOptionsMenu} method for the @link android.view.Window#FEATURE_OPTIONS_PANEL} /** 2498 * Default implementation of 2499 * {android.view.Window.Callback#onPreparePanel} 2500 * for activities. This 2501 * calls through to the new {#onPrepareOptionsMenu} method for the 2502 * {android.view.Window#FEATURE_OPTIONS_PANEL} 2503 * panel, so that subclasses of 2504 * Activity don't need to deal with feature codes. 2505 */

@inheritDoc} 2517 * 2518 * @return The default implementation returns true. /** 2516 * {The default implementation returns true. 2519 */

"Tried to open action bar menu with no action bar"

@link android.view.Window.Callback#onMenuItemSelected} @link #onOptionsItemSelected} method for the @link android.view.Window#FEATURE_OPTIONS_PANEL} /** 2533 * Default implementation of 2534 * {android.view.Window.Callback#onMenuItemSelected} 2535 * for activities. This calls through to the new 2536 * {#onOptionsItemSelected} method for the 2537 * {android.view.Window#FEATURE_OPTIONS_PANEL} 2538 * panel, so that subclasses of 2539 * Activity don't need to deal with feature codes. 2540 */

// Put event logging here so it gets called even if subclass

// doesn't call through to superclass's implmeentation of each

// of these methods below

50000

0

0

50000

1

@link android.view.Window.Callback#onPanelClosed(int, Menu)} for @link #onOptionsMenuClosed(Menu)} @link android.view.Window#FEATURE_OPTIONS_PANEL} panel, @link Window#FEATURE_CONTEXT_MENU}), the @link #onContextMenuClosed(Menu)} will be called. /** 2577 * Default implementation of 2578 * {android.view.Window.Callback#onPanelClosed(int, Menu)} for 2579 * activities. This calls through to {#onOptionsMenuClosed(Menu)} 2580 * method for the {android.view.Window#FEATURE_OPTIONS_PANEL} panel, 2581 * so that subclasses of Activity don't need to deal with feature codes. 2582 * For context menus ({Window#FEATURE_CONTEXT_MENU}), the 2583 * {#onContextMenuClosed(Menu)} will be called. 2584 */

@link #onCreateOptionsMenu(Menu)} method will be called the next /** 2604 * Declare that the options menu has changed, so should be recreated. 2605 * The {#onCreateOptionsMenu(Menu)} method will be called the next 2606 * time it needs to be displayed. 2607 */

@link #onPrepareOptionsMenu}. @link Menu#CATEGORY_SYSTEM} group so that @link #onOptionsItemSelected} method to handle them there. 2632 * @param menu The options menu in which you place your items. 2634 * @return You must return true for the menu to be displayed; 2637 * @see #onPrepareOptionsMenu @see #onOptionsItemSelected /** 2613 * Initialize the contents of the Activity's standard options menu. You 2614 * should place your menu items in to menu . 2615 2616 * This is only called once, the first time the options menu is 2617 * displayed. To update the menu every time it is displayed, see 2618 * {#onPrepareOptionsMenu}. 2619 2620 * The default implementation populates the menu with standard system 2621 * menu items. These are placed in the {Menu#CATEGORY_SYSTEM} group so that 2622 * they will be correctly ordered with application-defined menu items. 2623 * Deriving classes should always call through to the base implementation. 2624 2625 * You can safely hold on to menu (and any items created 2626 * from it), making modifications to it as desired, until the next 2627 * time onCreateOptionsMenu() is called. 2628 2629 * When you add items to the menu, you can implement the Activity's 2630 * {#onOptionsItemSelected} method to handle them there. 2631 menu The options menu in which you place your items. 2633 You must return true for the menu to be displayed; 2635 * if you return false it will not be shown. 2636 #onPrepareOptionsMenu 2638 #onOptionsItemSelected 2639 */

2657 * @param menu The options menu as last shown or first initialized by 2660 * @return You must return true for the menu to be displayed; 2663 * @see #onCreateOptionsMenu /** 2648 * Prepare the Screen's standard options menu to be displayed. This is 2649 * called right before the menu is shown, every time it is shown. You can 2650 * use this method to efficiently enable disable items or otherwise 2651 * dynamically modify the contents. 2652 2653 * The default implementation updates the system menu items based on the 2654 * activity's state. Deriving classes should always call through to the 2655 * base class implementation. 2656 menu The options menu as last shown or first initialized by 2658 * onCreateOptionsMenu(). 2659 You must return true for the menu to be displayed; 2661 * if you return false it will not be shown. 2662 #onCreateOptionsMenu 2664 */

2683 * @param item The menu item that was selected. 2685 * @return boolean Return false to allow normal menu processing to 2688 * @see #onCreateOptionsMenu /** 2673 * This hook is called whenever an item in your options menu is selected. 2674 * The default implementation simply returns false to have the normal 2675 * processing happen (calling the item's Runnable or sending a message to 2676 * its Handler as appropriate). You can use this method for any items 2677 * for which you would like to do processing without those other 2678 * facilities. 2679 2680 * Derived classes should call through to the base class for it to 2681 * perform the default menu handling. 2682 item The menu item that was selected. 2684 boolean Return false to allow normal menu processing to 2686 * proceed, true to consume it here. 2687 #onCreateOptionsMenu 2689 */

@link android.R.attr#parentActivityName parentActivityName} @link #onPrepareNavigateUpTaskStack(TaskStackBuilder)} @docRoot}guide/topics/fundamentals/@docRoot}design/patterns/@link TaskStackBuilder} class and the Activity methods @link #getParentActivityIntent()}, {@link #shouldUpRecreateTask(Intent)}, and @link #navigateUpTo(Intent)} for help implementing custom Up navigation. 2717 * @return true if Up navigation completed successfully and this Activity was finished, /** 2698 * This method is called whenever the user chooses to navigate Up within your application's 2699 * activity hierarchy from the action bar. 2700 2701 * If the attribute {android.R.attr#parentActivityName parentActivityName} 2702 * was specified in the manifest for this activity or an activity-alias to it, 2703 * default Up navigation will be handled automatically. If any activity 2704 * along the parent chain requires extra Intent arguments, the Activity subclass 2705 * should override the method {#onPrepareNavigateUpTaskStack(TaskStackBuilder)} 2706 * to supply those arguments. 2707 2708 * See tasks-and-back-stack.html ">Tasks and Back Stack 2709 * from the developer guide and navigation.html ">Navigation 2710 * from the design guide for more information about navigating within your app. 2711 2712 * See the {TaskStackBuilder} class and the Activity methods 2713 * {#getParentActivityIntent()}, {#shouldUpRecreateTask(Intent)}, and 2714 * {#navigateUpTo(Intent)} for help implementing custom Up navigation. 2715 * The AppNavigation sample application in the Android SDK is also available for reference. 2716 true if Up navigation completed successfully and this Activity was finished, 2718 * false otherwise. 2719 */

// Automatically handle hierarchical Up navigation if the proper

// metadata is available.

// Activities with a null affinity are special; they really shouldn't

// specify a parent activity intent in the first place. Just finish

// the current activity and call it a day.

// We can't finishAffinity if we have a result.

// Fall back and simply finish the current activity instead.

// Tell the developer what's going on to avoid hair-pulling.

"onNavigateUp only finishing topmost activity to return a result"

2757 * @param child The activity making the call. /** 2754 * This is called when a child activity of this one attempts to navigate up. 2755 * The default implementation simply calls onNavigateUp() on this activity (the parent). 2756 child The activity making the call. 2758 */

@link TaskStackBuilder}. Applications @link #onNavigateUp()} @link #shouldUpRecreateTask(Intent)} returns true when supplied with the intent @link #getParentActivityIntent()}.</p> @link #onPrepareNavigateUpTaskStack(TaskStackBuilder)}.</p> 2779 * @param builder An empty TaskStackBuilder - the application should add intents representing /** 2764 * Define the synthetic task stack that will be generated during Up navigation from 2765 * a different task. 2766 2767 * The default implementation of this method adds the parent chain of this activity 2768 * as specified in the manifest to the supplied {TaskStackBuilder}. Applications 2769 * may choose to override this method to construct the desired task stack in a different 2770 * way. 2771 2772 * This method will be invoked by the default implementation of {#onNavigateUp()} 2773 * if {#shouldUpRecreateTask(Intent)} returns true when supplied with the intent 2774 * returned by {#getParentActivityIntent()}. 2775 2776 * Applications that wish to supply extra Intent parameters to the parent stack defined 2777 * by the manifest should override {#onPrepareNavigateUpTaskStack(TaskStackBuilder)}. 2778 builder An empty TaskStackBuilder - the application should add intents representing 2780 * the desired task stack 2781 */

@link TaskStackBuilder} with the constructed series of @link #onCreateNavigateUpTaskStack(TaskStackBuilder)}. 2795 * @param builder A TaskStackBuilder that has been populated with Intents by /** 2787 * Prepare the synthetic task stack that will be generated during Up navigation 2788 * from a different task. 2789 2790 * This method receives the {TaskStackBuilder} with the constructed series of 2791 * Intents as generated by {#onCreateNavigateUpTaskStack(TaskStackBuilder)}. 2792 * If any extra data should be added to these intents before launching the new task, 2793 * the application should override this method and add that data here. 2794 builder A TaskStackBuilder that has been populated with Intents by 2796 * onCreateNavigateUpTaskStack. 2797 */

2805 * @param menu The options menu as last shown or first initialized by /** 2802 * This hook is called whenever the options menu is being closed (either by the user canceling 2803 * the menu with the back menu button, or when an item is selected). 2804 menu The options menu as last shown or first initialized by 2806 * onCreateOptionsMenu(). 2807 */

/** 2815 * Programmatically opens the options menu. If the options menu is already 2816 * open, this method does nothing. 2817 */

/** 2823 * Progammatically closes the options menu. If the options menu is already 2824 * closed, this method does nothing. 2825 */

@code view} is about to be shown. @link #onCreateOptionsMenu(Menu)}, this will be called every @link AdapterView} subclasses, @code menuInfo})). @link #onContextItemSelected(android.view.MenuItem)} to know when an @inheritDoc} /** 2831 * Called when a context menu for the {view} is about to be shown. 2832 * Unlike {#onCreateOptionsMenu(Menu)}, this will be called every 2833 * time the context menu is about to be shown and should be populated for 2834 * the view (or item inside the view for {AdapterView} subclasses, 2835 * this can be found in the {menuInfo})). 2836 * 2837 * Use {#onContextItemSelected(android.view.MenuItem)} to know when an 2838 * item has been selected. 2839 * 2840 * It is not safe to hold onto the context menu after this method returns. 2841 * { 2842 */

@link OnCreateContextMenuListener} on the view to this activity, so @link #onCreateContextMenu(ContextMenu, View, ContextMenuInfo)} will be 2853 * @see #unregisterForContextMenu(View) @param view The view that should show a context menu. /** 2847 * Registers a context menu to be shown for the given view (multiple views 2848 * can show the context menu). This method will set the 2849 * {OnCreateContextMenuListener} on the view to this activity, so 2850 * {#onCreateContextMenu(ContextMenu, View, ContextMenuInfo)} will be 2851 * called when it is time to show the context menu. 2852 #unregisterForContextMenu(View) 2854 view The view that should show a context menu. 2855 */

@link OnCreateContextMenuListener} on the view. 2864 * @see #registerForContextMenu(View) @param view The view that should stop showing a context menu. /** 2861 * Prevents a context menu to be shown for the given view. This method will remove the 2862 * {OnCreateContextMenuListener} on the view. 2863 #registerForContextMenu(View) 2865 view The view that should stop showing a context menu. 2866 */

@code view}. @code view} should have been added via @link #registerForContextMenu(View)}. 2876 * @param view The view to show the context menu for. /** 2872 * Programmatically opens the context menu for a particular {view}. 2873 * The {view} should have been added via 2874 * {#registerForContextMenu(View)}. 2875 view The view to show the context menu for. 2877 */

/** 2883 * Programmatically closes the most recently opened context menu, if showing. 2884 */

@link MenuItem#getMenuInfo()} to get extra information set by the 2902 * @param item The context menu item that was selected. @return boolean Return false to allow normal context menu processing to /** 2890 * This hook is called whenever an item in a context menu is selected. The 2891 * default implementation simply returns false to have the normal processing 2892 * happen (calling the item's Runnable or sending a message to its Handler 2893 * as appropriate). You can use this method for any items for which you 2894 * would like to do processing without those other facilities. 2895 * 2896 * Use {MenuItem#getMenuInfo()} to get extra information set by the 2897 * View that added this menu item. 2898 * 2899 * Derived classes should call through to the base class for it to perform 2900 * the default menu handling. 2901 item The context menu item that was selected. 2903 boolean Return false to allow normal context menu processing to 2904 * proceed, true to consume it here. 2905 */

2918 * @param menu The context menu that is being closed. /** 2914 * This hook is called whenever the context menu is being closed (either by 2915 * the user canceling the menu with the back menu button, or when an item is 2916 * selected). 2917 menu The context menu that is being closed. 2919 */

@deprecated Old no-arguments version of {@link #onCreateDialog(int, Bundle)}. /** 2927 Old no-arguments version of {#onCreateDialog(int, Bundle)}. 2928 */

@link #onCreateDialog(int)} for compatibility. @link android.os.Build.VERSION_CODES#HONEYCOMB} @link DialogFragment} instead.</em> @link #showDialog(int)}, the activity will call through to @link #showDialog}. @link #onPrepareDialog(int, Dialog, Bundle)}. 2954 * @param id The id of the dialog. @param args The dialog arguments provided to {@link #showDialog(int, Bundle)}. @return The dialog. If you return null, the dialog will not be created. 2958 * @see #onPrepareDialog(int, Dialog, Bundle) @see #showDialog(int, Bundle) @see #dismissDialog(int) @see #removeDialog(int) 2963 * @deprecated Use the new {@link DialogFragment} class with @link FragmentManager} instead; this is also /** 2935 * Callback for creating dialogs that are managed (saved and restored) for you 2936 * by the activity. The default implementation calls through to 2937 * {#onCreateDialog(int)} for compatibility. 2938 2939 * If you are targeting {android.os.Build.VERSION_CODES#HONEYCOMB} 2940 * or later, consider instead using a {DialogFragment} instead. 2941 2942 * If you use {#showDialog(int)}, the activity will call through to 2943 * this method the first time, and hang onto it thereafter. Any dialog 2944 * that is created by this method will automatically be saved and restored 2945 * for you, including whether it is showing. 2946 2947 * If you would like the activity to manage saving and restoring dialogs 2948 * for you, you should override this method and handle any ids that are 2949 * passed to {#showDialog}. 2950 2951 * If you would like an opportunity to prepare your dialog before it is shown, 2952 * override {#onPrepareDialog(int, Dialog, Bundle)}. 2953 id The id of the dialog. 2955 args The dialog arguments provided to {#showDialog(int, Bundle)}. 2956 The dialog. If you return null, the dialog will not be created. 2957 #onPrepareDialog(int, Dialog, Bundle) 2959 #showDialog(int, Bundle) 2960 #dismissDialog(int) 2961 #removeDialog(int) 2962 Use the new {DialogFragment} class with 2964 * {FragmentManager} instead; this is also 2965 * available on older platforms through the Android compatibility package. 2966 */

@deprecated Old no-arguments version of @link #onPrepareDialog(int, Dialog, Bundle)}. /** 2973 Old no-arguments version of 2974 * {#onPrepareDialog(int, Dialog, Bundle)}. 2975 */

@link #onPrepareDialog(int, Dialog)} for compatibility. 2993 * @param id The id of the managed dialog. @param dialog The dialog. @param args The dialog arguments provided to {@link #showDialog(int, Bundle)}. @see #onCreateDialog(int, Bundle) @see #showDialog(int) @see #dismissDialog(int) @see #removeDialog(int) 3001 * @deprecated Use the new {@link DialogFragment} class with @link FragmentManager} instead; this is also /** 2982 * Provides an opportunity to prepare a managed dialog before it is being 2983 * shown. The default implementation calls through to 2984 * {#onPrepareDialog(int, Dialog)} for compatibility. 2985 2986 * 2987 * Override this if you need to update a managed dialog based on the state 2988 * of the application each time it is shown. For example, a time picker 2989 * dialog might want to be updated with the current time. You should call 2990 * through to the superclass's implementation. The default implementation 2991 * will set this Activity as the owner activity on the Dialog. 2992 id The id of the managed dialog. 2994 dialog The dialog. 2995 args The dialog arguments provided to {#showDialog(int, Bundle)}. 2996 #onCreateDialog(int, Bundle) 2997 #showDialog(int) 2998 #dismissDialog(int) 2999 #removeDialog(int) 3000 Use the new {DialogFragment} class with 3002 * {FragmentManager} instead; this is also 3003 * available on older platforms through the Android compatibility package. 3004 */

@link #showDialog(int, Bundle)} that does not @link #showDialog(int, Bundle)} 3015 * @deprecated Use the new {@link DialogFragment} class with @link FragmentManager} instead; this is also /** 3011 * Simple version of {#showDialog(int, Bundle)} that does not 3012 * take any arguments. Simply calls {#showDialog(int, Bundle)} 3013 * with null arguments. 3014 Use the new {DialogFragment} class with 3016 * {FragmentManager} instead; this is also 3017 * available on older platforms through the Android compatibility package. 3018 */

@link #onCreateDialog(int, Bundle)} @link android.os.Build.VERSION_CODES#HONEYCOMB} @link DialogFragment} instead.</em> @link #onPrepareDialog(int, Dialog, Bundle)} will 3035 * @param id The id of the managed dialog. @param args Arguments to pass through to the dialog. These will be saved @link #onCreateDialog(int, Bundle)} will not be called with the new @link #onPrepareDialog(int, Dialog, Bundle)} will be. @link #removeDialog(int)} first. @return Returns true if the Dialog was created; false is returned if @link #onCreateDialog(int, Bundle)} returns false. 3044 * @see Dialog @see #onCreateDialog(int, Bundle) @see #onPrepareDialog(int, Dialog, Bundle) @see #dismissDialog(int) @see #removeDialog(int) 3050 * @deprecated Use the new {@link DialogFragment} class with @link FragmentManager} instead; this is also /** 3025 * Show a dialog managed by this activity. A call to {#onCreateDialog(int, Bundle)} 3026 * will be made with the same id the first time this is called for a given 3027 * id. From thereafter, the dialog will be automatically saved and restored. 3028 3029 * If you are targeting {android.os.Build.VERSION_CODES#HONEYCOMB} 3030 * or later, consider instead using a {DialogFragment} instead. 3031 3032 * Each time a dialog is shown, {#onPrepareDialog(int, Dialog, Bundle)} will 3033 * be made to provide an opportunity to do any timely preparation. 3034 id The id of the managed dialog. 3036 args Arguments to pass through to the dialog. These will be saved 3037 * and restored for you. Note that if the dialog is already created, 3038 * {#onCreateDialog(int, Bundle)} will not be called with the new 3039 * arguments but {#onPrepareDialog(int, Dialog, Bundle)} will be. 3040 * If you need to rebuild the dialog, call {#removeDialog(int)} first. 3041 Returns true if the Dialog was created; false is returned if 3042 * it is not created because {#onCreateDialog(int, Bundle)} returns false. 3043 Dialog 3045 #onCreateDialog(int, Bundle) 3046 #onPrepareDialog(int, Dialog, Bundle) 3047 #dismissDialog(int) 3048 #removeDialog(int) 3049 Use the new {DialogFragment} class with 3051 * {FragmentManager} instead; this is also 3052 * available on older platforms through the Android compatibility package. 3053 */

@link #showDialog(int)}. 3078 * @param id The id of the managed dialog. 3080 * @throws IllegalArgumentException if the id was not previously shown via @link #showDialog(int)}. 3083 * @see #onCreateDialog(int, Bundle) @see #onPrepareDialog(int, Dialog, Bundle) @see #showDialog(int) @see #removeDialog(int) 3088 * @deprecated Use the new {@link DialogFragment} class with @link FragmentManager} instead; this is also /** 3076 * Dismiss a dialog that was previously shown via {#showDialog(int)}. 3077 id The id of the managed dialog. 3079 IllegalArgumentException if the id was not previously shown via 3081 * {#showDialog(int)}. 3082 #onCreateDialog(int, Bundle) 3084 #onPrepareDialog(int, Dialog, Bundle) 3085 #showDialog(int) 3086 #removeDialog(int) 3087 Use the new {DialogFragment} class with 3089 * {FragmentManager} instead; this is also 3090 * available on older platforms through the Android compatibility package. 3091 */

/** 3106 * Creates an exception to throw if a user passed in a dialog id that is 3107 * unexpected. 3108 */

"no dialog with id "

" was ever "

"shown via Activity#showDialog"

@link android.os.Build.VERSION_CODES#GINGERBREAD}, this function 3125 * @param id The id of the managed dialog. 3127 * @see #onCreateDialog(int, Bundle) @see #onPrepareDialog(int, Dialog, Bundle) @see #showDialog(int) @see #dismissDialog(int) 3132 * @deprecated Use the new {@link DialogFragment} class with @link FragmentManager} instead; this is also /** 3115 * Removes any internal references to a dialog managed by this Activity. 3116 * If the dialog is showing, it will dismiss it as part of the clean up. 3117 3118 * This can be useful if you know that you will never show a dialog again and 3119 * want to avoid the overhead of saving and restoring it in the future. 3120 3121 * As of {android.os.Build.VERSION_CODES#GINGERBREAD}, this function 3122 * will not throw an exception if you try to remove an ID that does not 3123 * currently have an associated dialog. 3124 id The id of the managed dialog. 3126 #onCreateDialog(int, Bundle) 3128 #onPrepareDialog(int, Dialog, Bundle) 3129 #showDialog(int) 3130 #dismissDialog(int) 3131 Use the new {DialogFragment} class with 3133 * {FragmentManager} instead; this is also 3134 * available on older platforms through the Android compatibility package. 3135 */

@link #startSearch startSearch(null, false, null, false)}, which launches @link SearchManager}. 3159 * @return Returns {@code true} if search launched, and {@code false} if activity blocks it. @code true}. 3162 * @see android.app.SearchManager /** 3148 * This hook is called when the user signals the desire to start a search. 3149 3150 * You can use this function as a simple way to launch the search UI, in response to a 3151 * menu item, search button, or other widgets within your activity. Unless overidden, 3152 * calling this function is the same as calling 3153 * {#startSearch startSearch(null, false, null, false)}, which launches 3154 * search for the current activity as specified in its manifest, see {SearchManager}. 3155 3156 * You can override this function to force global search, e.g. in response to a dedicated 3157 * search key, or to block search entirely (by simply returning false). 3158 Returns {true} if search launched, and {false} if activity blocks it. 3160 * The default implementation always returns {true}. 3161 android.app.SearchManager 3163 */

3179 * @param initialQuery Any non-null non-empty string will be inserted as @param selectInitialQuery If true, the intial query will be preselected, which means that @param appSearchData An application can insert application-specific @param globalSearch If false, this will only launch the search that has been specifically 3196 * @see android.app.SearchManager @see #onSearchRequested /** 3170 * This hook is called to launch the search UI. 3171 3172 * It is typically called from onSearchRequested(), either directly from 3173 * Activity.onSearchRequested() or from an overridden version in any given 3174 * Activity. If your goal is simply to activate search, it is preferred to call 3175 * onSearchRequested(), which may have been overriden elsewhere in your Activity. If your goal 3176 * is to inject specific data such as context data, it is preferred to override 3177 * onSearchRequested(), so that any callers to it will benefit from the override. 3178 initialQuery Any non-null non-empty string will be inserted as 3180 * pre-entered text in the search query box. 3181 selectInitialQuery If true, the intial query will be preselected, which means that 3182 * any further typing will replace it. This is useful for cases where an entire pre-formed 3183 * query is being inserted. If false, the selection point will be placed at the end of the 3184 * inserted query. This is useful when the inserted query is text that the user entered, 3185 * and the user would expect to be able to keep typing. This parameter is only meaningful 3186 * if initialQuery is a non-empty string. 3187 appSearchData An application can insert application-specific 3188 * context here, in order to improve quality or specificity of its own 3189 * searches. This data will be returned with SEARCH intent(s). Null if 3190 * no extra data is required. 3191 globalSearch If false, this will only launch the search that has been specifically 3192 * defined by the application (which is usually defined as a local search). If no default 3193 * search is defined in the current application or activity, global search will be launched. 3194 * If true, this will always launch a platform-global (e.g. web-based) search instead. 3195 android.app.SearchManager 3197 #onSearchRequested 3198 */

@link #startSearch}, but actually fires off the search query after invoking 3210 * @param query The query to trigger. If empty, the request will be ignored. @param appSearchData An application can insert application-specific /** 3207 * Similar to {#startSearch}, but actually fires off the search query after invoking 3208 * the search dialog. Made available for testing purposes. 3209 query The query to trigger. If empty, the request will be ignored. 3211 appSearchData An application can insert application-specific 3212 * context here, in order to improve quality or specificity of its own 3213 * searches. This data will be returned with SEARCH intent(s). Null if 3214 * no extra data is required. 3215 */

3226 * @see android.view.Window#takeKeyEvents /** 3222 * Request that key events come to this activity. Use this if your 3223 * activity has no views with focus, but the activity still wants 3224 * a chance to process key events. 3225 android.view.Window#takeKeyEvents 3227 */

@link android.view.Window#requestFeature getWindow().requestFeature()}. 3236 * @param featureId The desired feature as defined in @link android.view.Window}. @return Returns true if the requested feature is supported and now 3241 * @see android.view.Window#requestFeature /** 3233 * Enable extended window features. This is a convenience for calling 3234 * {android.view.Window#requestFeature getWindow().requestFeature()}. 3235 featureId The desired feature as defined in 3237 * {android.view.Window}. 3238 Returns true if the requested feature is supported and now 3239 * enabled. 3240 android.view.Window#requestFeature 3242 */

@link MenuInflater} with this context. /** 3288 * Returns a {MenuInflater} with this context. 3289 */

// Make sure that action views can get an appropriate theme.

// Empty

@link #startActivityForResult(Intent, int, Bundle)} 3322 * @param intent The intent to start. @param requestCode If >= 0, this code will be returned in 3326 * @throws android.content.ActivityNotFoundException 3328 * @see #startActivity /** 3319 * Same as calling {#startActivityForResult(Intent, int, Bundle)} 3320 * with no options. 3321 intent The intent to start. 3323 requestCode If >= 0, this code will be returned in 3324 * onActivityResult() when the activity exits. 3325 android.content.ActivityNotFoundException 3327 #startActivity 3329 */

@link #startActivity} (the activity is not launched as a sub-activity). @link Intent#ACTION_MAIN} or {@link Intent#ACTION_VIEW}), you may @link android.content.ActivityNotFoundException} 3357 * @param intent The intent to start. @param requestCode If >= 0, this code will be returned in @param options Additional options for how the Activity should be started. @link android.content.Context#startActivity(Intent, Bundle) 3364 * @throws android.content.ActivityNotFoundException 3366 * @see #startActivity /** 3335 * Launch an activity for which you would like a result when it finished. 3336 * When this activity exits, your 3337 * onActivityResult() method will be called with the given requestCode. 3338 * Using a negative requestCode is the same as calling 3339 * {#startActivity} (the activity is not launched as a sub-activity). 3340 3341 * Note that this method should only be used with Intent protocols 3342 * that are defined to return a result. In other protocols (such as 3343 * {Intent#ACTION_MAIN} or {Intent#ACTION_VIEW}), you may 3344 * not get the result when you expect. For example, if the activity you 3345 * are launching uses the singleTask launch mode, it will not run in your 3346 * task and thus you will immediately receive a cancel result. 3347 3348 * As a special case, if you call startActivityForResult() with a requestCode 3349 * >= 0 during the initial onCreate(Bundle savedInstanceState)/onResume() of your 3350 * activity, then your window will not be displayed until a result is 3351 * returned back from the started activity. This is to avoid visible 3352 * flickering when redirecting to another activity. 3353 3354 * This method throws {android.content.ActivityNotFoundException} 3355 * if there was no Activity found to run the given Intent. 3356 intent The intent to start. 3358 requestCode If >= 0, this code will be returned in 3359 * onActivityResult() when the activity exits. 3360 options Additional options for how the Activity should be started. 3361 * See {android.content.Context#startActivity(Intent, Bundle) 3362 * Context.startActivity(Intent, Bundle)} for more details. 3363 android.content.ActivityNotFoundException 3365 #startActivity 3367 */

0

// If this start is requesting a result, we can avoid making

// the activity visible until the result is received. Setting

// this code during onCreate(Bundle savedInstanceState) or onResume() will keep the

// activity hidden during this time, to avoid flickering.

// This can only be done when a result is requested because

// that guarantees we will get information back when the

// activity is finished, no matter what happens to it.

// Note we want to go through this method for compatibility with

// existing applications that may have overridden it.

@hide Implement to provide correct calling token. /** 3401 Implement to provide correct calling token. 3402 */

@hide Implement to provide correct calling token. /** 3408 Implement to provide correct calling token. 3409 */

"Called be called from a child"

1

1

@link #startIntentSenderForResult(IntentSender, int, 3429 * @param intent The IntentSender to launch. @param requestCode If >= 0, this code will be returned in @param fillInIntent If non-null, this will be provided as the @link IntentSender#sendIntent}. @param flagsMask Intent flags in the original IntentSender that you @param flagsValues Desired values for any bits set in @param extraFlags Always set to 0. /** 3426 * Same as calling {#startIntentSenderForResult(IntentSender, int, 3427 * Intent, int, int, int, Bundle)} with no options. 3428 intent The IntentSender to launch. 3430 requestCode If >= 0, this code will be returned in 3431 * onActivityResult() when the activity exits. 3432 fillInIntent If non-null, this will be provided as the 3433 * intent parameter to {IntentSender#sendIntent}. 3434 flagsMask Intent flags in the original IntentSender that you 3435 * would like to change. 3436 flagsValues Desired values for any bits set in 3437 * flagsMask 3438 extraFlags Always set to 0. 3439 */

@link #startActivityForResult(Intent, int)}, but allowing you @link #startActivityForResult(Intent, int)} @link IntentSender#sendIntent IntentSender.sendIntent} on it. 3456 * @param intent The IntentSender to launch. @param requestCode If >= 0, this code will be returned in @param fillInIntent If non-null, this will be provided as the @link IntentSender#sendIntent}. @param flagsMask Intent flags in the original IntentSender that you @param flagsValues Desired values for any bits set in @param extraFlags Always set to 0. @param options Additional options for how the Activity should be started. @link android.content.Context#startActivity(Intent, Bundle) /** 3448 * Like {#startActivityForResult(Intent, int)}, but allowing you 3449 * to use a IntentSender to describe the activity to be started. If 3450 * the IntentSender is for an activity, that activity will be started 3451 * as if you had called the regular {#startActivityForResult(Intent, int)} 3452 * here; otherwise, its associated action will be executed (such as 3453 * sending a broadcast) as if you had called 3454 * {IntentSender#sendIntent IntentSender.sendIntent} on it. 3455 intent The IntentSender to launch. 3457 requestCode If >= 0, this code will be returned in 3458 * onActivityResult() when the activity exits. 3459 fillInIntent If non-null, this will be provided as the 3460 * intent parameter to {IntentSender#sendIntent}. 3461 flagsMask Intent flags in the original IntentSender that you 3462 * would like to change. 3463 flagsValues Desired values for any bits set in 3464 * flagsMask 3465 extraFlags Always set to 0. 3466 options Additional options for how the Activity should be started. 3467 * See {android.content.Context#startActivity(Intent, Bundle) 3468 * Context.startActivity(Intent, Bundle)} for more details. If options 3469 * have also been supplied by the IntentSender, options given here will 3470 * override any that conflict with those given by the IntentSender. 3471 */

// Note we want to go through this call for compatibility with

// existing applications that may have overridden the method.

0

// If this start is requesting a result, we can avoid making

// the activity visible until the result is received. Setting

// this code during onCreate(Bundle savedInstanceState) or onResume() will keep the

// activity hidden during this time, to avoid flickering.

// This can only be done when a result is requested because

// that guarantees we will get information back when the

// activity is finished, no matter what happens to it.

@link #startActivity(Intent, Bundle)} with no options 3525 * @param intent The intent to start. 3527 * @throws android.content.ActivityNotFoundException 3529 * @see {@link #startActivity(Intent, Bundle)} @see #startActivityForResult /** 3522 * Same as {#startActivity(Intent, Bundle)} with no options 3523 * specified. 3524 intent The intent to start. 3526 android.content.ActivityNotFoundException 3528 #startActivity(Intent, Bundle)} 3530 #startActivityForResult 3531 */

@link Intent#FLAG_ACTIVITY_NEW_TASK} launch flag is not @link android.content.ActivityNotFoundException} 3549 * @param intent The intent to start. @param options Additional options for how the Activity should be started. @link android.content.Context#startActivity(Intent, Bundle) 3554 * @throws android.content.ActivityNotFoundException 3556 * @see {@link #startActivity(Intent)} @see #startActivityForResult /** 3538 * Launch a new activity. You will not receive any information about when 3539 * the activity exits. This implementation overrides the base version, 3540 * providing information about 3541 * the activity performing the launch. Because of this additional 3542 * information, the {Intent#FLAG_ACTIVITY_NEW_TASK} launch flag is not 3543 * required; if not specified, the new activity will be added to the 3544 * task of the caller. 3545 3546 * This method throws {android.content.ActivityNotFoundException} 3547 * if there was no Activity found to run the given Intent. 3548 intent The intent to start. 3550 options Additional options for how the Activity should be started. 3551 * See {android.content.Context#startActivity(Intent, Bundle) 3552 * Context.startActivity(Intent, Bundle)} for more details. 3553 android.content.ActivityNotFoundException 3555 #startActivity(Intent)} 3557 #startActivityForResult 3558 */

1

// Note we want to go through this call for compatibility with

// applications that may have overridden the method.

1

@link #startActivities(Intent[], Bundle)} with no options 3574 * @param intents The intents to start. 3576 * @throws android.content.ActivityNotFoundException 3578 * @see {@link #startActivities(Intent[], Bundle)} @see #startActivityForResult /** 3571 * Same as {#startActivities(Intent[], Bundle)} with no options 3572 * specified. 3573 intents The intents to start. 3575 android.content.ActivityNotFoundException 3577 #startActivities(Intent[], Bundle)} 3579 #startActivityForResult 3580 */

@link Intent#FLAG_ACTIVITY_NEW_TASK} launch flag is not @link android.content.ActivityNotFoundException} 3598 * @param intents The intents to start. @param options Additional options for how the Activity should be started. @link android.content.Context#startActivity(Intent, Bundle) 3603 * @throws android.content.ActivityNotFoundException 3605 * @see {@link #startActivities(Intent[])} @see #startActivityForResult /** 3587 * Launch a new activity. You will not receive any information about when 3588 * the activity exits. This implementation overrides the base version, 3589 * providing information about 3590 * the activity performing the launch. Because of this additional 3591 * information, the {Intent#FLAG_ACTIVITY_NEW_TASK} launch flag is not 3592 * required; if not specified, the new activity will be added to the 3593 * task of the caller. 3594 3595 * This method throws {android.content.ActivityNotFoundException} 3596 * if there was no Activity found to run the given Intent. 3597 intents The intents to start. 3599 options Additional options for how the Activity should be started. 3600 * See {android.content.Context#startActivity(Intent, Bundle) 3601 * Context.startActivity(Intent, Bundle)} for more details. 3602 android.content.ActivityNotFoundException 3604 #startActivities(Intent[])} 3606 #startActivityForResult 3607 */

@lin