added in version 25.1.0
belongs to Maven artifact com.android.support:appcompat-v7:28.0.0-alpha1

AppCompatActivity

public class AppCompatActivity
extends FragmentActivity implements AppCompatCallback, TaskStackBuilder.SupportParentable, ActionBarDrawerToggle.DelegateProvider

java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.view.ContextThemeWrapper
         ↳ android.app.Activity
           ↳ android.support.v4.app.FragmentActivity
             ↳ android.support.v7.app.AppCompatActivity


Base class for activities that use the support library action bar features.

You can add an ActionBar to your activity when running on API level 7 or higher by extending this class for your activity and setting the activity theme to Theme.AppCompat or a similar theme.

Developer Guides

For information about how to use the action bar, including how to add action items, navigation modes and more, read the Action Bar API guide.

Summary

Inherited constants

From class android.app.Activity
From class android.content.Context
From interface android.content.ComponentCallbacks2

Inherited fields

From class android.app.Activity

Public constructors

AppCompatActivity()

Public methods

void addContentView(View view, ViewGroup.LayoutParams params)
void closeOptionsMenu()
boolean dispatchKeyEvent(KeyEvent event)
<T extends View> T findViewById(int id)
AppCompatDelegate getDelegate()
ActionBarDrawerToggle.Delegate getDrawerToggleDelegate()
MenuInflater getMenuInflater()
Resources getResources()
ActionBar getSupportActionBar()

Support library version of getActionBar().

Intent getSupportParentActivityIntent()

Obtain an Intent that will launch an explicit target activity specified by sourceActivity's PARENT_ACTIVITY <meta-data> element in the application's manifest.

void invalidateOptionsMenu()
void onConfigurationChanged(Configuration newConfig)

Dispatch configuration change to all fragments.

void onContentChanged()
void onCreateSupportNavigateUpTaskStack(TaskStackBuilder builder)

Support version of onCreateNavigateUpTaskStack(android.app.TaskStackBuilder).

boolean onKeyDown(int keyCode, KeyEvent event)
final boolean onMenuItemSelected(int featureId, MenuItem item)

Dispatch context and options menu to fragments.

boolean onMenuOpened(int featureId, Menu menu)

Please note: AppCompat uses its own feature id for the action bar: FEATURE_SUPPORT_ACTION_BAR.

void onPanelClosed(int featureId, Menu menu)

Call onOptionsMenuClosed() on fragments.

Please note: AppCompat uses its own feature id for the action bar: FEATURE_SUPPORT_ACTION_BAR.

void onPrepareSupportNavigateUpTaskStack(TaskStackBuilder builder)

Support version of onPrepareNavigateUpTaskStack(android.app.TaskStackBuilder).

void on