6

As a user of Android Studio, I'd like to know where a string in strings.xml is used because I want to remove the strings which aren't in use.

2 Answers 2

12

rightclick Right click on a string in your strings.xml-> click "Find Usages" to see where it's used.

no usages

If it's not used anywhere then a little dialog will pop up in the corner saying so.

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

1 Comment

Thank you for your answer! It is what I want to know.
4

Easier way to find unused strings in Strings.xml is to launch an inspection code from top menu of Android Studio (Analyse/Inspect code) on whole project.

In the inspection window, go to "Android Lint/Unused ressources", there you will find all the unused strings.

It will avoid you to make "find Usages" for lot of strings !

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.