Added in API level 1
Deprecated in API level 30

LauncherActivity


abstract class LauncherActivity : ListActivity
kotlin.Any
   ↳ android.content.Context
   ↳ android.content.ContextWrapper
   ↳ android.view.ContextThemeWrapper
   ↳ android.app.Activity
   ↳ android.app.ListActivity
   ↳ android.app.LauncherActivity

Displays a list of all activities which can be performed for a given intent. Launches when clicked.

Summary

Nested classes
open

Utility class to resize icons to match default icon size.

open

An item in the list

Inherited constants
Public constructors

Public methods
open MutableList<LauncherActivity.ListItem!>!

Perform the query to determine which results to show and return a list of them.

open Unit
setTitle(titleId: Int)

Change the title associated with this activity.

open Unit

Change the title associated with this activity.

Protected methods
open Intent!

Get the base intent to use when running PackageManager.queryIntentActivities(Intent, int).

open Intent!

Return the actual Intent for a specific position in our android.widget.ListView.

open LauncherActivity.ListItem!
itemForPosition(position: Int)

Return the ListItem for a specific position in our android.widget.ListView.

open Unit
onCreate(icicle: Bundle?)

Called when the activity is starting.

open Unit
onListItemClick(l: ListView!, v: View!, position: Int, id: Long)

This method will be called when an item in the list is selected.

open MutableList<ResolveInfo!>!

Perform query on package manager for list items.

open Unit

Override to call setContentView() with your own content view to customize the list layout.

Inherited functions
Inherited properties

Public constructors

LauncherActivity

LauncherActivity()

Public methods

makeListItems

Added in API level 3
Deprecated in API level 30
open fun makeListItems(): MutableList<LauncherActivity.ListItem!>!

Deprecated: Deprecated in Java.

Perform the query to determine which results to show and return a list of them.

setTitle

Added in API level 1
open fun setTitle(titleId: Int): Unit

Deprecated: Deprecated in Java.

Change the title associated with this activity. If this is a top-level activity, the title for its window will change. If it is an embedded activity, the parent can do whatever it wants with it.

setTitle

Added in API level 1
open fun setTitle(title: CharSequence!): Unit

Deprecated: Deprecated in Java.

Change the title associated with this activity. If this is a top-level activity, the title for its window will change. If it is an embedded activity, the parent can do whatever it wants with it.

Protected methods

getTargetIntent

Added in API level 1
protected open fun getTargetIntent(): Intent!

Deprecated: Deprecated in Java.

Get the base intent to use when running PackageManager.queryIntentActivities(Intent, int).

intentForPosition

Added in API level 3
Deprecated in API level 30
protected open fun intentForPosition(position: Int): Intent!

Deprecated: Deprecated in Java.

Return the actual Intent for a specific position in our android.widget.ListView.

Parameters
position Int: The item whose Intent to return

itemForPosition

Added in API level 4
Deprecated in API level 30
protected open fun itemForPosition(position: Int): LauncherActivity.ListItem!

Deprecated: Deprecated in Java.

Return the ListItem for a specific position in our android.widget.ListView.

Parameters
position Int: The item to return

onCreate

Added in API level 1
protected open fun onCreate(icicle: Bundle?): Unit

Deprecated: Deprecated in Java.

Called when the activity is starting. This is where most initialization should go: calling setContentView(int) to inflate the activity's UI, using findViewById to programmatically interact with widgets in the UI, calling managedQuery(android.net.Uri,java.lang.String[],java.lang.String,java.lang.String[],java.lang.String) to retrieve cursors for data being displayed, etc.

You can call finish from within this function, in which case onDestroy() will be immediately called after #onCreate without any of the rest of the activity lifecycle (onStart, onResume, onPause, etc.) executing.

Derived classes must call through to the super class's implementation of this method. If they do not, an exception will be thrown.

.
This method must be called from the main thread of your app.
If you override this method you must call through to the superclass implementation.
Parameters
savedInstanceState If the activity is being re-initialized after previously being shut down then this Bundle contains the data it most recently supplied in #onSaveInstanceState. Note: Otherwise it is null.

onListItemClick

Added in API level 1
protected open fun onListItemClick(
    l: ListView!,
    v: View!,
    position: Int,
    id: Long
): Unit

Deprecated: Deprecated in Java.

This method will be called when an item in the list is selected. Subclasses should override. Subclasses can call getListView().getItemAtPosition(position) if they need to access the data associated with the selected item.

Parameters
l ListView!: The ListView where the click happened
v View!: The view that was clicked within the ListView
position Int: The position of the view in the list
id Long: The row id of the item that was clicked

onQueryPackageManager

Added in API level 5
Deprecated in API level 30
protected open fun onQueryPackageManager(queryIntent: Intent!): MutableList<ResolveInfo!>!

Deprecated: Deprecated in Java.

Perform query on package manager for list items. The default implementation queries for activities.

onSetContentView

Added in API level 5
Deprecated in API level 30
protected open fun onSetContentView(): Unit

Deprecated: Deprecated in Java.

Override to call setContentView() with your own content view to customize the list layout.