Externalize strings for Android project

后端 未结 3 1133
旧巷少年郎
旧巷少年郎 2020-12-09 10:23

Is there any Eclipse plugin that takes strings from code and puts them in strings.xml? I found \"Externalize strings\" function in Eclipse, but I don\'t know how to get it t

相关标签:
3条回答
  • 2020-12-09 10:58

    You can also position your cursor over the string literal and press ctrl+1. Then choose "externalize" by the android icon.

    Credits: Do externalized strings need to be in strings.xml?

    0 讨论(0)
  • 2020-12-09 11:02

    use shortcut Alt+Shift+A and after that press S. it'll solve your problem.

    0 讨论(0)
  • 2020-12-09 11:12

    Use Refactor in Eclipse:

    • highlight the string
    • From the Eclipse menu select Refactor -> Android -> Extract Android String.

    The string will be moved to strings.xml and the call to getContext().getString(R.string.my_string) generated.

    0 讨论(0)
提交回复
热议问题