Called by the system when the device configuration changes while your activity is running. This hook is called whenever an item in a context menu is selected. OnCreate Bundle. Called when the activity is starting.
OnCreate Bundle, PersistableBundle. Generate a new description for this activity. OnCreateDialog Int OnCreateDialog Int32, Bundle. Callback for creating dialogs that are managed saved and restored for you by the activity. Initialize the contents of the Activity's standard options menu. OnCreatePanelView Int OnCreateThumbnail Bitmap, Canvas. Generate a new thumbnail for this activity.
Perform any final cleanup before an activity is destroyed. Activities cannot draw during the period that their windows are animating in.
Called when a generic motion event was not handled by any of the views inside of the activity. Called when a key was pressed down and not handled by any of the views inside of the activity. Called when a key shortcut event is not handled by any of the views in the Activity. Called when a key was released and not handled by any of the views inside of the activity. Called when a panel's menu is opened by the user.
This is called when a child activity of this one attempts to navigate up. OnNewIntent Intent. This hook is called whenever an item in your options menu is selected. OnPostCreate Bundle. OnPrepareDialog Int32, Dialog. Provides an opportunity to prepare a managed dialog before it is being shown.
Prepare the Screen's standard options menu to be displayed. OnProvideAssistData Bundle. OnRestoreInstanceState Bundle. OnSaveInstanceState Bundle. Called when the user signals the desire to start a search.
OnSearchRequested SearchEvent. Called when you are no longer visible to the user. OnTitleChanged String, Color. OnTouchEvent MotionEvent. Called when a touch screen event was not handled by any of the views under it. OnTrackballEvent MotionEvent. Called when the trackball was moved and not handled by any of the views inside of the activity. OnTrimMemory TrimMemory. Called whenever a key, touch, or trackball event is dispatched to the activity. This is called whenever the current window attributes change.
OnWindowFocusChanged Boolean. Give the Activity a chance to control the UI for an action mode requested by the system. OpenContextMenu View. OpenFileInput String. Open a private file associated with this Context's application package for reading. Open a private file associated with this Context's application package for writing.
Programmatically opens the options menu. OverridePendingTransition Int32, Int Cause this Activity to be recreated with a new instance. RegisterForContextMenu View. Register a BroadcastReceiver to be run in the main activity thread.
Register to receive intent broadcasts, to run in the context of scheduler. Ask that the local app instance of this activity be released to free up its memory. RemoveDialog Int Removes any internal references to a dialog managed by this Activity. RemoveStickyBroadcast Intent. RequestPermissions String[], Int RequestVisibleBehind Boolean.
RequestWindowFeature WindowFeatures. Enable extended window features. RunOnUiThread Action. Runs the specified action on the UI thread. SendBroadcast Intent.
Broadcast the given intent to all interested BroadcastReceivers. SendBroadcast Intent, String. SendOrderedBroadcast Intent, String. SendStickyBroadcast Intent.
SetActionBar Toolbar. SetContentView Int Set the activity content from a layout resource. SetContentView View. Set the activity content to an explicit view. Select the default key handling for this activity. Sets whether this activity is finished when touched outside its window's bounds.
SetPersistent Boolean. SetProgress Int Sets the progress for the progress bars in the title. SetProgressBarIndeterminate Boolean. Sets the visibility of the indeterminate progress bar in the title. SetProgressBarVisibility Boolean. Sets the visibility of the progress bar in the title. SetResult Result. Call this to set the result that your activity will return to its caller. SetResult Result, Intent.
SetSecondaryProgress Int Sets the secondary progress for the progress bar in the title. SetSelection Int Set the currently selected list item to the specified position with the adapter's data. SetShowWhenLocked Boolean. SetTheme Int Set the base theme for this context.
SetTitle Int Change the title associated with this activity. SetTurnScreenOn Boolean. SetVisible Boolean. Control whether this activity's main window is visible. You can do anything you can do in an Activity in a ListActivity.
Raghav Sood Raghav Sood 80k 20 20 gold badges silver badges bronze badges. Andy Res Andy Res Dzhuneyt Dzhuneyt 7, 11 11 gold badges 58 58 silver badges bronze badges. Sign up or log in Sign up using Google.
Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Does ES6 make JavaScript frameworks obsolete? Podcast Do polyglots have an edge when it comes to mastering programming Featured on Meta. Now live: A fully responsive profile. Please sign in or sign up to post. Welcome to the Treehouse Community The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support.
Looking to learn something new? Posted September 18, pm by sameer sai sameer sai 1, Points. It would be great if someone could explain this to me. What if I wanted to change the layout in the future to a GridView? I was just curious about "best practices" in this regard and what the benefits entail, so any answer would be helpful :.
I'd use a ListActivity since it gives you a lot of shortcut methods to make things easier and keep your code more readable. For example, you get the onListItemClick method which is called whenever you click a item which saves you from creating a separate listener.
0コメント