diff options
author | Roman Nurik <romannurik@google.com> | 2012-10-01 13:00:24 -0700 |
---|---|---|
committer | Roman Nurik <romannurik@google.com> | 2012-10-01 13:00:24 -0700 |
commit | 228754925c73ac777f4c2df990f1a50e0b3bec75 (patch) | |
tree | 17d6dbd2606461849cffdfc5ae1cd903479add40 /templates | |
parent | 68e7bebeb651920e115db5986b30f3099e724a08 (diff) | |
download | sdk-228754925c73ac777f4c2df990f1a50e0b3bec75.zip sdk-228754925c73ac777f4c2df990f1a50e0b3bec75.tar.gz sdk-228754925c73ac777f4c2df990f1a50e0b3bec75.tar.bz2 |
Ensure ADT app templates' activity onCreate is protected.
It's considered a best practice for activity onCreate overrides to maintain the
original visibility of the method, which is protected. Implement this for all
activity templates.
Change-Id: Ia501628a3f330f671398935103fafc1834f8e78e
Diffstat (limited to 'templates')
7 files changed, 9 insertions, 8 deletions
diff --git a/templates/activities/BlankActivity/root/src/app_package/DropdownActivity.java.ftl b/templates/activities/BlankActivity/root/src/app_package/DropdownActivity.java.ftl index fb19202..f2549ad 100644 --- a/templates/activities/BlankActivity/root/src/app_package/DropdownActivity.java.ftl +++ b/templates/activities/BlankActivity/root/src/app_package/DropdownActivity.java.ftl @@ -26,7 +26,7 @@ public class ${activityClass} extends FragmentActivity implements ActionBar.OnNa private static final String STATE_SELECTED_NAVIGATION_ITEM = "selected_navigation_item"; @Override - public void onCreate(Bundle savedInstanceState) { + protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.${layoutName}); diff --git a/templates/activities/BlankActivity/root/src/app_package/SimpleActivity.java.ftl b/templates/activities/BlankActivity/root/src/app_package/SimpleActivity.java.ftl index a409ad4..feae824 100644 --- a/templates/activities/BlankActivity/root/src/app_package/SimpleActivity.java.ftl +++ b/templates/activities/BlankActivity/root/src/app_package/SimpleActivity.java.ftl @@ -11,7 +11,7 @@ import android.support.v4.app.NavUtils; public class ${activityClass} extends Activity { @Override - public void onCreate(Bundle savedInstanceState) { + protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.${layoutName}); <#if parentActivityClass != ""> diff --git a/templates/activities/BlankActivity/root/src/app_package/TabsActivity.java.ftl b/templates/activities/BlankActivity/root/src/app_package/TabsActivity.java.ftl index b0a2f5d..0bf975e 100644 --- a/templates/activities/BlankActivity/root/src/app_package/TabsActivity.java.ftl +++ b/templates/activities/BlankActivity/root/src/app_package/TabsActivity.java.ftl @@ -23,7 +23,7 @@ public class ${activityClass} extends FragmentActivity implements ActionBar.TabL private static final String STATE_SELECTED_NAVIGATION_ITEM = "selected_navigation_item"; @Override - public void onCreate(Bundle savedInstanceState) { + protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.${layoutName}); diff --git a/templates/activities/BlankActivity/root/src/app_package/TabsAndPagerActivity.java.ftl b/templates/activities/BlankActivity/root/src/app_package/TabsAndPagerActivity.java.ftl index 9e82449..7aa79bd 100644 --- a/templates/activities/BlankActivity/root/src/app_package/TabsAndPagerActivity.java.ftl +++ b/templates/activities/BlankActivity/root/src/app_package/TabsAndPagerActivity.java.ftl @@ -35,7 +35,7 @@ public class ${activityClass} extends FragmentActivity<#if navType?contains("tab ViewPager mViewPager; @Override - public void onCreate(Bundle savedInstanceState) { + protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.${layoutName}); diff --git a/templates/activities/FullscreenActivity/root/src/app_package/FullscreenActivity.java.ftl b/templates/activities/FullscreenActivity/root/src/app_package/FullscreenActivity.java.ftl index 3040c67..729cbec 100755 --- a/templates/activities/FullscreenActivity/root/src/app_package/FullscreenActivity.java.ftl +++ b/templates/activities/FullscreenActivity/root/src/app_package/FullscreenActivity.java.ftl @@ -49,7 +49,8 @@ public class ${activityClass} extends Activity { */ private SystemUiHider mSystemUiHider; - public void onCreate(Bundle savedInstanceState) { + @Override + protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.${layoutName}); diff --git a/templates/activities/LoginActivity/root/src/app_package/LoginActivity.java.ftl b/templates/activities/LoginActivity/root/src/app_package/LoginActivity.java.ftl index d766051..8defdc7 100644 --- a/templates/activities/LoginActivity/root/src/app_package/LoginActivity.java.ftl +++ b/templates/activities/LoginActivity/root/src/app_package/LoginActivity.java.ftl @@ -55,8 +55,8 @@ public class ${activityClass} extends Activity { private TextView mLoginStatusMessageView; @Override - public void onCreate(Bundle icicle) { - super.onCreate(icicle); + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); setContentView(R.layout.${layoutName}); <#if parentActivityClass != ""> diff --git a/templates/activities/MasterDetailFlow/root/src/app_package/ContentListActivity.java.ftl b/templates/activities/MasterDetailFlow/root/src/app_package/ContentListActivity.java.ftl index cbd815e..ae73f7d 100644 --- a/templates/activities/MasterDetailFlow/root/src/app_package/ContentListActivity.java.ftl +++ b/templates/activities/MasterDetailFlow/root/src/app_package/ContentListActivity.java.ftl @@ -32,7 +32,7 @@ public class ${CollectionName}Activity extends FragmentActivity private boolean mTwoPane; @Override - public void onCreate(Bundle savedInstanceState) { + protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_${collection_name}); <#if parentActivityClass != ""> |