ryo
ryo

Reputation: 2167

How to know where a string in strings.xml is used

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.

Upvotes: 6

Views: 2547

Answers (2)

Christian
Christian

Reputation: 747

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 !

Upvotes: 4

Matter Cat
Matter Cat

Reputation: 1578

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.

Upvotes: 12

Related Questions