Android: Activity vs AppCompatActivity

By default, Android Studio create new Activity based by AppCompatActivity. In this way, additional modules, such as Android support library will added to the project. But in many cases you can use the basic Activity class. You can choose Activity insted of AppCompatActivity if:

  1. target API is 21 or higher (Android 5+) 
  2. target API is 17 or higher (Android 4.2+) and you do not use Matherial Design 
  3. target API is 15 or higher (Android 4.03+) and you do not use Nested Fragments and Matherial Design.

In last case, if you want to use Nested Fragments but don't want Matherial Design, you can use FragmentActivity.

Comments

Popular posts from this blog

Installing and using a free GeoIP database

Create custom Spinner on ActionBar