public class ResolverActivity extends Activity
Modifier and Type | Class and Description |
---|---|
class |
ResolverActivity.DisplayResolveInfo |
class |
ResolverActivity.ResolveListAdapter |
static interface |
ResolverActivity.TargetInfo
A single target as represented in the chooser.
|
Activity.TranslucentConversionListener
Context.BindServiceFlags, Context.CreatePackageOptions, Context.ServiceName
Modifier and Type | Field and Description |
---|---|
protected ResolverDrawerLayout |
mResolverDrawerLayout |
DEFAULT_KEYS_DIALER, DEFAULT_KEYS_DISABLE, DEFAULT_KEYS_SEARCH_GLOBAL, DEFAULT_KEYS_SEARCH_LOCAL, DEFAULT_KEYS_SHORTCUT, DONT_FINISH_TASK_WITH_ACTIVITY, FINISH_TASK_WITH_ACTIVITY, FINISH_TASK_WITH_ROOT_ACTIVITY, FOCUSED_STATE_SET, RESULT_CANCELED, RESULT_FIRST_USER, RESULT_OK
ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, APP_OPS_SERVICE, APPWIDGET_SERVICE, AUDIO_SERVICE, BACKUP_SERVICE, BATTERY_SERVICE, BIND_ABOVE_CLIENT, BIND_ADJUST_WITH_ACTIVITY, BIND_ALLOW_OOM_MANAGEMENT, BIND_ALLOW_WHITELIST_MANAGEMENT, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_EXTERNAL_SERVICE, BIND_FOREGROUND_SERVICE, BIND_FOREGROUND_SERVICE_WHILE_AWAKE, BIND_IMPORTANT, BIND_NOT_FOREGROUND, BIND_NOT_VISIBLE, BIND_SHOWING_UI, BIND_TREAT_LIKE_ACTIVITY, BIND_VISIBLE, BIND_WAIVE_PRIORITY, BLUETOOTH_SERVICE, CAMERA_SERVICE, CAPTIONING_SERVICE, CARRIER_CONFIG_SERVICE, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONSUMER_IR_SERVICE, CONTEXT_CREDENTIAL_PROTECTED_STORAGE, CONTEXT_DEVICE_PROTECTED_STORAGE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_REGISTER_PACKAGE, CONTEXT_RESTRICTED, CONTEXTHUB_SERVICE, COUNTRY_DETECTOR, DEVICE_IDLE_CONTROLLER, DEVICE_POLICY_SERVICE, DISPLAY_SERVICE, DOWNLOAD_SERVICE, DROPBOX_SERVICE, ETHERNET_SERVICE, FINGERPRINT_SERVICE, GATEKEEPER_SERVICE, HARDWARE_PROPERTIES_SERVICE, HDMI_CONTROL_SERVICE, INPUT_METHOD_SERVICE, INPUT_SERVICE, JOB_SCHEDULER_SERVICE, KEYGUARD_SERVICE, LAUNCHER_APPS_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MEDIA_PROJECTION_SERVICE, MEDIA_ROUTER_SERVICE, MEDIA_SESSION_SERVICE, MIDI_SERVICE, MODE_APPEND, MODE_ENABLE_WRITE_AHEAD_LOGGING, MODE_MULTI_PROCESS, MODE_NO_LOCALIZED_COLLATORS, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NETWORK_POLICY_SERVICE, NETWORK_SCORE_SERVICE, NETWORK_STATS_SERVICE, NETWORKMANAGEMENT_SERVICE, NFC_SERVICE, NOTIFICATION_SERVICE, NSD_SERVICE, PERSISTENT_DATA_BLOCK_SERVICE, POWER_SERVICE, PRINT_SERVICE, RADIO_SERVICE, RECOVERY_SERVICE, RESTRICTIONS_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, SERIAL_SERVICE, SHORTCUT_SERVICE, SIP_SERVICE, SOUND_TRIGGER_SERVICE, STATUS_BAR_SERVICE, STORAGE_SERVICE, SYSTEM_HEALTH_SERVICE, TELECOM_SERVICE, TELEPHONY_SERVICE, TELEPHONY_SUBSCRIPTION_SERVICE, TEXT_SERVICES_MANAGER_SERVICE, TRUST_SERVICE, TV_INPUT_SERVICE, UI_MODE_SERVICE, UPDATE_LOCK_SERVICE, USAGE_STATS_SERVICE, USB_SERVICE, USER_SERVICE, VIBRATOR_SERVICE, VOICE_INTERACTION_MANAGER_SERVICE, WALLPAPER_SERVICE, WIFI_NAN_SERVICE, WIFI_P2P_SERVICE, WIFI_RTT_SERVICE, WIFI_SCANNING_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN
Constructor and Description |
---|
ResolverActivity() |
Modifier and Type | Method and Description |
---|---|
boolean |
configureContentView(List<Intent> payloadIntents,
Intent[] initialIntents,
List<ResolveInfo> rList,
boolean alwaysUseOption)
Returns true if the activity is finishing and creation should halt
|
ResolverActivity.ResolveListAdapter |
createAdapter(Context context,
List<Intent> payloadIntents,
Intent[] initialIntents,
List<ResolveInfo> rList,
int launchedFromUid,
boolean filterLastUsed) |
static int |
getLabelRes(String action)
Get the string resource to be used as a label for the link to the resolver activity for an
action.
|
int |
getLayoutResource() |
Intent |
getReplacementIntent(ActivityInfo aInfo,
Intent defIntent)
Replace me in subclasses!
|
Intent |
getTargetIntent() |
protected CharSequence |
getTitleForAction(String action,
int defaultTitleRes) |
boolean |
isComponentFiltered(ComponentInfo component) |
void |
onActivityStarted(ResolverActivity.TargetInfo cti) |
void |
onButtonClick(View v) |
protected void |
onCreate(Bundle savedInstanceState)
Called when the activity is starting.
|
protected void |
onCreate(Bundle savedInstanceState,
Intent intent,
CharSequence title,
Intent[] initialIntents,
List<ResolveInfo> rList,
boolean alwaysUseOption)
Compatibility version for other bundled services that use this overload without
a default title resource
|
protected void |
onCreate(Bundle savedInstanceState,
Intent intent,
CharSequence title,
int defaultTitleRes,
Intent[] initialIntents,
List<ResolveInfo> rList,
boolean alwaysUseOption) |
protected void |
onDestroy()
Perform any final cleanup before an activity is destroyed.
|
void |
onPrepareAdapterView(AbsListView adapterView,
ResolverActivity.ResolveListAdapter adapter,
boolean alwaysUseOption) |
protected void |
onRestart()
Called after
Activity.onStop() when the current activity is being
re-displayed to the user (the user has navigated back to it). |
protected void |
onRestoreInstanceState(Bundle savedInstanceState)
This method is called after
Activity.onStart() when the activity is
being re-initialized from a previously saved state, given here in
savedInstanceState. |
void |
onSetupVoiceInteraction()
Perform any initialization needed for voice interaction.
|
protected void |
onStop()
Called when you are no longer visible to the user.
|
protected boolean |
onTargetSelected(ResolverActivity.TargetInfo target,
boolean alwaysCheck) |
void |
safelyStartActivity(ResolverActivity.TargetInfo cti) |
void |
sendVoiceChoicesIfNeeded() |
protected void |
setAdditionalTargets(Intent[] intents) |
void |
setFilteredComponents(ComponentName[] components) |
void |
setSafeForwardingMode(boolean safeForwarding)
Turn on launch mode that is safe to use when forwarding intents received from
applications and running in system processes.
|
boolean |
shouldAutoLaunchSingleChoice(ResolverActivity.TargetInfo target) |
boolean |
shouldGetActivityMetadata() |
void |
showTargetDetails(ResolveInfo ri) |
void |
startSelected(int which,
boolean always,
boolean filtered) |
addContentView, canStartActivityForResult, closeContextMenu, closeOptionsMenu, convertFromTranslucent, convertToTranslucent, createPendingResult, dismissDialog, dismissKeyboardShortcutsHelper, dispatchEnterAnimationComplete, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, dump, enterPictureInPictureMode, enterPictureInPictureModeIfPossible, exitFreeformMode, findViewById, finish, finishActivity, finishActivityFromChild, finishAffinity, finishAfterTransition, finishAndRemoveTask, finishFromChild, getActionBar, getActivityToken, getApplication, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getContentScene, getContentTransitionManager, getCurrentFocus, getFragmentManager, getIntent, getLastNonConfigurationInstance, getLayoutInflater, getLoaderManager, getLocalClassName, getMediaController, getMenuInflater, getParent, getParentActivityIntent, getPreferences, getReferrer, getRequestedOrientation, getSearchEvent, getSystemService, getTaskId, getTitle, getTitleColor, getVoiceInteractor, getVolumeControlStream, getWindow, getWindowManager, getWindowStackId, hasWindowFocus, invalidateOptionsMenu, isBackgroundVisibleBehind, isChangingConfigurations, isChild, isDestroyed, isFinishing, isImmersive, isInMultiWindowMode, isInPictureInPictureMode, isLocalVoiceInteractionSupported, isOverlayWithDecorCaptionEnabled, isResumed, isTaskRoot, isVoiceInteraction, isVoiceInteractionRoot, managedQuery, managedQuery, moveTaskToBack, navigateUpTo, navigateUpToFromChild, onActionModeFinished, onActionModeStarted, onActivityReenter, onActivityResult, onApplyThemeResource, onAttachedToWindow, onAttachFragment, onBackgroundVisibleBehindChanged, onBackPressed, onChildTitleChanged, onConfigurationChanged, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreate, onCreateContextMenu, onCreateDescription, onCreateDialog, onCreateDialog, onCreateNavigateUpTaskStack, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onCreateThumbnail, onCreateView, onCreateView, onDetachedFromWindow, onEnterAnimationComplete, onGenericMotionEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyShortcut, onKeyUp, onLocalVoiceInteractionStarted, onLocalVoiceInteractionStopped, onLowMemory, onMenuItemSelected, onMenuOpened, onMultiWindowModeChanged, onNavigateUp, onNavigateUpFromChild, onNewActivityOptions, onNewIntent, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPause, onPictureInPictureModeChanged, onPostCreate, onPostCreate, onPostResume, onPrepareDialog, onPrepareDialog, onPrepareNavigateUpTaskStack, onPrepareOptionsMenu, onPreparePanel, onProvideAssistContent, onProvideAssistData, onProvideKeyboardShortcuts, onProvideReferrer, onRequestPermissionsResult, onRestoreInstanceState, onResume, onRetainNonConfigurationInstance, onSaveInstanceState, onSaveInstanceState, onSearchRequested, onSearchRequested, onStart, onStateNotSaved, onTitleChanged, onTouchEvent, onTrackballEvent, onTrimMemory, onUserInteraction, onUserLeaveHint, onVisibleBehindCanceled, onWindowAttributesChanged, onWindowDismissed, onWindowFocusChanged, onWindowStartingActionMode, onWindowStartingActionMode, openContextMenu, openOptionsMenu, overridePendingTransition, postponeEnterTransition, recreate, registerForContextMenu, releaseInstance, removeDialog, reportFullyDrawn, requestDragAndDropPermissions, requestPermissions, requestShowKeyboardShortcuts, requestVisibleBehind, requestWindowFeature, runOnUiThread, setActionBar, setContentTransitionManager, setContentView, setContentView, setContentView, setDefaultKeyMode, setEnterSharedElementCallback, setExitSharedElementCallback, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setFinishOnTouchOutside, setImmersive, setIntent, setMediaController, setOverlayWithDecorCaptionEnabled, setPersistent, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRequestedOrientation, setResult, setResult, setSecondaryProgress, setTaskDescription, setTheme, setTitle, setTitle, setTitleColor, setVisible, setVolumeControlStream, setVrModeEnabled, shouldShowRequestPermissionRationale, shouldUpRecreateTask, showAssist, showDialog, showDialog, showLockTaskEscapeMessage, startActionMode, startActionMode, startActivities, startActivities, startActivity, startActivity, startActivityAsCaller, startActivityAsUser, startActivityAsUser, startActivityForResult, startActivityForResult, startActivityForResult, startActivityForResultAsUser, startActivityForResultAsUser, startActivityFromChild, startActivityFromChild, startActivityFromFragment, startActivityFromFragment, startActivityIfNeeded, startActivityIfNeeded, startIntentSender, startIntentSender, startIntentSenderForResult, startIntentSenderForResult, startIntentSenderFromChild, startIntentSenderFromChild, startIntentSenderFromChildFragment, startLocalVoiceInteraction, startLockTask, startManagingCursor, startNextMatchingActivity, startNextMatchingActivity, startPostponedEnterTransition, startSearch, stopLocalVoiceInteraction, stopLockTask, stopManagingCursor, takeKeyEvents, triggerSearch, unregisterForContextMenu
applyOverrideConfiguration, attachBaseContext, getAssets, getOverrideConfiguration, getResources, getTheme, getThemeResId
bindService, bindServiceAsUser, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkPermission, checkSelfPermission, checkUriPermission, checkUriPermission, checkUriPermission, clearWallpaper, createApplicationContext, createConfigurationContext, createCredentialProtectedStorageContext, createDeviceProtectedStorageContext, createDisplayContext, createPackageContext, createPackageContextAsUser, databaseList, deleteDatabase, deleteFile, deleteSharedPreferences, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getBaseContext, getBasePackageName, getCacheDir, getClassLoader, getCodeCacheDir, getContentResolver, getDatabasePath, getDataDir, getDir, getDisplay, getDisplayAdjustments, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getExternalMediaDirs, getFilesDir, getFileStreamPath, getMainLooper, getNoBackupFilesDir, getObbDir, getObbDirs, getOpPackageName, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getSharedPreferences, getSharedPreferences, getSharedPreferencesPath, getSystemServiceName, getUserId, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isCredentialProtectedStorage, isDeviceProtectedStorage, isRestricted, moveDatabaseFrom, moveSharedPreferencesFrom, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, registerReceiverAsUser, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeUriPermission, sendBroadcast, sendBroadcast, sendBroadcast, sendBroadcast, sendBroadcastAsUser, sendBroadcastAsUser, sendBroadcastAsUser, sendBroadcastMultiplePermissions, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendOrderedBroadcastAsUser, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setWallpaper, setWallpaper, startActivitiesAsUser, startInstrumentation, startService, startServiceAsUser, stopService, stopServiceAsUser, unbindService, unregisterReceiver
bindServiceAsUser, createCredentialEncryptedStorageContext, createDeviceEncryptedStorageContext, getColor, getColorStateList, getDrawable, getSharedPrefsFile, getString, getString, getSystemService, getText, isCredentialEncryptedStorage, isDeviceEncryptedStorage, migrateDatabaseFrom, migrateSharedPreferencesFrom, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, registerComponentCallbacks, unregisterComponentCallbacks
protected ResolverDrawerLayout mResolverDrawerLayout
@StringRes public static int getLabelRes(String action)
action
- The action to resolveprotected void onCreate(Bundle savedInstanceState)
Activity
Activity.setContentView(int)
to inflate the
activity's UI, using Activity.findViewById(int)
to programmatically interact
with widgets in the UI, calling
Activity.managedQuery(android.net.Uri , String[], String, String[], String)
to retrieve
cursors for data being displayed, etc.
You can call Activity.finish(int)
from within this function, in
which case onDestroy() will be immediately called without any of the rest
of the activity lifecycle (Activity.onStart()
, Activity.onResume()
,
Activity.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.
onCreate
in class Activity
savedInstanceState
- If the activity is being re-initialized after
previously being shut down then this Bundle contains the data it most
recently supplied in Activity.onSaveInstanceState(android.os.Bundle)
. Note: Otherwise it is null.Activity.onStart()
,
Activity.onSaveInstanceState(android.os.Bundle)
,
Activity.onRestoreInstanceState(android.os.Bundle)
,
Activity.onPostCreate(android.os.Bundle)
protected void onCreate(Bundle savedInstanceState, Intent intent, CharSequence title, Intent[] initialIntents, List<ResolveInfo> rList, boolean alwaysUseOption)
protected void onCreate(Bundle savedInstanceState, Intent intent, CharSequence title, int defaultTitleRes, Intent[] initialIntents, List<ResolveInfo> rList, boolean alwaysUseOption)
public final void setFilteredComponents(ComponentName[] components)
public final boolean isComponentFiltered(ComponentInfo component)
public void onSetupVoiceInteraction()
public void sendVoiceChoicesIfNeeded()
protected final void setAdditionalTargets(Intent[] intents)
public Intent getTargetIntent()
public int getLayoutResource()
public void setSafeForwardingMode(boolean safeForwarding)
This mode is set to true by default if the activity is initialized through
onCreate(android.os.Bundle)
. If a subclass calls one of the other onCreate
methods, it is set to false by default. You must set it before calling one of the
more detailed onCreate methods, so that it will be set correctly in the case where
there is only one intent to resolve and it is thus started immediately.
protected CharSequence getTitleForAction(String action, int defaultTitleRes)
protected void onRestart()
Activity
Activity.onStop()
when the current activity is being
re-displayed to the user (the user has navigated back to it). It will
be followed by Activity.onStart()
and then Activity.onResume()
.
For activities that are using raw Cursor
objects (instead of
creating them through
Activity.managedQuery(android.net.Uri , String[], String, String[], String)
,
this is usually the place
where the cursor should be requeried (because you had deactivated it in
Activity.onStop()
.
Derived classes must call through to the super class's implementation of this method. If they do not, an exception will be thrown.
onRestart
in class Activity
Activity.onStop()
,
Activity.onStart()
,
Activity.onResume()
protected void onStop()
Activity
Activity.onRestart()
, Activity.onDestroy()
, or nothing,
depending on later user activity.
Derived classes must call through to the super class's implementation of this method. If they do not, an exception will be thrown.
onStop
in class Activity
Activity.onRestart()
,
Activity.onResume()
,
Activity.onSaveInstanceState(android.os.Bundle)
,
Activity.onDestroy()
protected void onDestroy()
Activity
Activity.finish(int)
on it, or because the system is temporarily destroying
this instance of the activity to save space. You can distinguish
between these two scenarios with the Activity.isFinishing()
method.
Note: do not count on this method being called as a place for
saving data! For example, if an activity is editing data in a content
provider, those edits should be committed in either Activity.onPause()
or
Activity.onSaveInstanceState(android.os.Bundle)
, not here. This method is usually implemented to
free resources like threads that are associated with an activity, so
that a destroyed activity does not leave such things around while the
rest of its application is still running. There are situations where
the system will simply kill the activity's hosting process without
calling this method (or any others) in it, so it should not be used to
do things that are intended to remain around after the process goes
away.
Derived classes must call through to the super class's implementation of this method. If they do not, an exception will be thrown.
onDestroy
in class Activity
Activity.onPause()
,
Activity.onStop()
,
Activity.finish(int)
,
Activity.isFinishing()
protected void onRestoreInstanceState(Bundle savedInstanceState)
Activity
Activity.onStart()
when the activity is
being re-initialized from a previously saved state, given here in
savedInstanceState. Most implementations will simply use Activity.onCreate(android.os.Bundle)
to restore their state, but it is sometimes convenient to do it here
after all of the initialization has been done or to allow subclasses to
decide whether to use your default implementation. The default
implementation of this method performs a restore of any view state that
had previously been frozen by Activity.onSaveInstanceState(android.os.Bundle)
.
This method is called between Activity.onStart()
and
Activity.onPostCreate(android.os.Bundle)
.
onRestoreInstanceState
in class Activity
savedInstanceState
- the data most recently supplied in Activity.onSaveInstanceState(android.os.Bundle)
.Activity.onCreate(android.os.Bundle)
,
Activity.onPostCreate(android.os.Bundle)
,
Activity.onResume()
,
Activity.onSaveInstanceState(android.os.Bundle)
public void onButtonClick(View v)
public void startSelected(int which, boolean always, boolean filtered)
public Intent getReplacementIntent(ActivityInfo aInfo, Intent defIntent)
protected boolean onTargetSelected(ResolverActivity.TargetInfo target, boolean alwaysCheck)
public void safelyStartActivity(ResolverActivity.TargetInfo cti)
public void onActivityStarted(ResolverActivity.TargetInfo cti)
public boolean shouldGetActivityMetadata()
public boolean shouldAutoLaunchSingleChoice(ResolverActivity.TargetInfo target)
public void showTargetDetails(ResolveInfo ri)
public ResolverActivity.ResolveListAdapter createAdapter(Context context, List<Intent> payloadIntents, Intent[] initialIntents, List<ResolveInfo> rList, int launchedFromUid, boolean filterLastUsed)
public boolean configureContentView(List<Intent> payloadIntents, Intent[] initialIntents, List<ResolveInfo> rList, boolean alwaysUseOption)
public void onPrepareAdapterView(AbsListView adapterView, ResolverActivity.ResolveListAdapter adapter, boolean alwaysUseOption)