Michal Chudy
Michal Chudy

Reputation: 1893

Is there way for extracting string resources in Android project in IntelliJ IDE?

When I'm working on Android project I would like to use some magic shortcut that would extract my string to strings.xml and also allow me to change the key. Is there any?

If there isn't, is there a way to develop new refactorization methods and extend IntelliJ possibilities?

Upvotes: 15

Views: 6639

Answers (3)

Juri
Juri

Reputation: 1

If you're using eclipse, you can highlight the string you want extracted to strings.xml, press Alt + Shift + A and in the small pop-up on the lower right of the screen select "Extract Android String"

Upvotes: 0

Boyan Bonev
Boyan Bonev

Reputation: 1

There is the Eclipse's option: Source / Externalize strings, which externalizes the strings of a class into a .properties file, but it does not seem to be able to export them directly to strings.xml in the Android way.

Upvotes: 0

CrazyCoder
CrazyCoder

Reputation: 401935

Alt+Enter (to invoke intention action menu) on a string, then use Add a string resource action from the menu.

To rename resource use Refactor | Rename while standing on a resource name in Java code, it will rename all the references and the resource itself.

Upvotes: 21

Related Questions