1

If I have the following in a layout XML:

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="string Test" />

it flags the 4th line "Hardcoded string should use @string resource" Fine, I know that, and would like to. Is there an option to select this line and have the IDE automatically add a <string></string> to the strings.xml and replace the android:text= to refer to that resource?

1
  • 1
    I think this is not possible because their is no any plugins of eclipse to do this..:( Commented Nov 27, 2013 at 5:07

1 Answer 1

0

Yes, there is an option to do this by selecting the text and have the IDE automatically do the job, just thank to JAL :

How to add string resources in Eclipse?

By the way, in JAL's answer, when he says GO TO REFACTOR, he means REFACTOR in the menu bar, not right click's context menu.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.