I am using the new appCompat v22.1, and I would like to change the templates used by Android Studio.
Currently, the Android Studio templates create Activities that extend ActionBarActivity
which has been deprecated in v22.1. I would like to switch to AppCompatActivity
without changing the code each time.
Is it possible to change them without waiting for the next Android Studio update?
Yes it can be done:
Activity templates are located 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 import of ActionBarActivity and ActionBarActivity with AppCompatActivity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With