How to add string resources in Eclipse?

后端 未结 4 1252
Happy的楠姐
Happy的楠姐 2021-02-07 10:08

Can I have Eclipse adding my string resources as I code or do I have to switch to string.xml all the time and add each string?

4条回答
  •  庸人自扰
    2021-02-07 10:44

    Eclipse will sort of do it for you. So if you have a field:

    android:text="hello"
    

    Select "hello" and then goto Refactor-->Android-->Extract Android String, Eclipse will change the line to:

    android:text="@string/hello"
    

    and automagically add the line to strings.xml as:

    Hello
    

    JAL

提交回复
热议问题