Jayyrus
Jayyrus

Reputation: 13051

Android studio generates deprecated activity

i've used Android Studio 1.3.1 to create a new TabbedActivity using his templates.

The problem is that it generates an activity using ActionBar.TabListener and actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); that are deprecated.

Using google i've checked that the actual standard needs SlidingTabsBasic or PagerTabStripin place of TabListener etc..

How can i configure Android Studio in order to use new standard ( with support library ) API?

Upvotes: 0

Views: 136

Answers (2)

Anton Vasilev
Anton Vasilev

Reputation: 104

As mentioned CommonsWare - the next Android Studio's update will fix this issue

But if you don't want to wait - you can manually change the template in the location:

android-studio/plugins/android/lib/templates/activities/TabbedActivity/root/src/app_package/*.ftl

And be carefull - changing some lines can brake the template! (The generated in Android Studio project will have one-two empty files) So, the first thing - make a backup of all this folder (plugins/android/lib/templates/), and you can rollback the files in case of failure.

Upvotes: 0

CommonsWare
CommonsWare

Reputation: 1006614

How can i configure Android Studio in order to use new standard ( with support library ) API?

You don't.

You either wait patiently for some future release of Android Studio to ship with updated templates, or you ignore the templates, or you don't use Android Studio.

Since this issue, this issue, and this issue were closed on September 3rd, I would hope that Android Studio 1.4 or 1.5 will address them.

Upvotes: 1

Related Questions