How can I change the template that Android Studio uses to create a blank activity -
i change template new activity uses appcompatactivity
instead of depreciated actionbaractivity
i found sdk\tools\templates\activities\blankactivity\root\src\app_package\simpleactivity.java.ftl
, after making backup copy changed
import <#if appcompat>android.support.v7.app.actionbaractivity<#else>android.app.activity</#if>;
to
import <#if appcompat>import android.support.v7.app.appcompatactivity<#else>android.app.activity</#if>;
and
public class ${activityclass} extends ${(appcompat)?string('actionbar','')}activity {
to
public class ${activityclass} extends ${(appcompat)?string('appcompat','')}activity {
but when create new activity still uses actionbaractivity.
i change 2 position:
1.import <#if appcompat>android.support.v7.app.appcompatactivity<#else>android.app.activity;
2.public class ${activityclass} extends ${(appcompat)?string('appcompat','')}activity {
and it's work me!
i see code, first edit has 1 more "import" string. -_-|||
edit: way, edit simpleactivity.java.ftl
under android-studio folder:"x:\xxxx\android-studio\plugins\android\lib\templates\activities\blankactivity\root\src\app_package"
Comments
Post a Comment