Where can I find Android Studio templates for Activity and gradle script?

I am using the new appCompat v22.1 and I would like to change the templates used by Android Studio.

Currently, Android Studio templates create actions that extend the ActionBarActivity , which are deprecated in version 22.1. I would like to switch to AppCompatActivity without changing the code every time.

Can I change them without waiting for the next update for Android Studio?

+5
source share
1 answer

Yes, this can be done:

The action templates are here: [ANDROID_STUDIO_DIR] \ plugins \ android \ lib \ templates \ activities

  • find the template you want to change

  • open \ XXXActivity \ root \ src \ app_package \ XXXActivity.java.ftl , find and replace the import of ActionBarActivity and ActionBarActivity using AppCompatActivity.

+4
source

All Articles