belongs to Maven artifact com.android.support:appcompat-v7:28.0.0-alpha1
AppCompatDelegate
public
abstract
class
AppCompatDelegate
extends Object
java.lang.Object | |
↳ | android.support.v7.app.AppCompatDelegate |
This class represents a delegate which you can use to extend AppCompat's support to any
Activity
.
When using an AppCompatDelegate
, you should call the following methods instead of the
Activity
method of the same name:
addContentView(android.view.View, android.view.ViewGroup.LayoutParams)
setContentView(int)
setContentView(android.view.View)
setContentView(android.view.View, android.view.ViewGroup.LayoutParams)
requestWindowFeature(int)
hasWindowFeature(int)
invalidateOptionsMenu()
startSupportActionMode(android.support.v7.view.ActionMode.Callback)
setSupportActionBar(android.support.v7.widget.Toolbar)
getSupportActionBar()
getMenuInflater()
findViewById(int)
The following methods should be called from the Activity
method of the
same name:
onCreate(android.os.Bundle)
onPostCreate(android.os.Bundle)
onConfigurationChanged(android.content.res.Configuration)
onStart()
onStop()
onPostResume()
onSaveInstanceState(Bundle)
setTitle(CharSequence)
onStop()
onDestroy()
An Activity
can only be linked with one AppCompatDelegate
instance,
therefore the instance returned from create(Activity, AppCompatCallback)
should be
retained until the Activity is destroyed.
Summary
Constants | |
---|---|
int |
FEATURE_ACTION_MODE_OVERLAY
Flag for specifying the behavior of action modes when an Action Bar is not present. |
int |
FEATURE_SUPPORT_ACTION_BAR
Flag for enabling the support Action Bar. |
int |
FEATURE_SUPPORT_ACTION_BAR_OVERLAY
Flag for requesting an support Action Bar that overlays window content. |
int |
MODE_NIGHT_AUTO
Mode which means to use night mode when it is determined that it is night or not. |
int |
MODE_NIGHT_FOLLOW_SYSTEM
Mode which uses the system's night mode setting to determine if it is night or not. |
int |
MODE_NIGHT_NO
Mode which means to not use night mode, and therefore prefer |
int |
MODE_NIGHT_YES
Mode which means to always use night mode, and therefore prefer |
Public methods | |
---|---|
abstract
void
|
addContentView(View v, ViewGroup.LayoutParams lp)
Should be called instead of
|
abstract
boolean
|
applyDayNight()
Allow AppCompat to apply the |
static
|