How can I extract string resource directly from Java class which suggest key itself, as we do from xml.
Asked
Active
Viewed 410 times
-4
-
I think your question is not clear. please enter some more details – vm345 May 18 '18 at 10:32
-
@vm345 Edited question – Khemraj Sharma May 18 '18 at 10:35
-
All guys thought i am asking about popup, but it's not that. – Khemraj Sharma May 18 '18 at 10:36
-
this [link](https://medium.com/@q2ad/android-automatic-string-extraction-ce7431d80147) may be useful for you – vm345 May 18 '18 at 10:58
3 Answers
2
Click ctrl+shift+a
and type intensions and select the first item,Or click file-> settings -> Editor ->intensions. Enable extract string resources.

hushed_voice
- 3,161
- 3
- 34
- 66
-
-
-
-
-
-
-
-
if that is enabled it should show up with alt + enter. where is it not showing up?(in toasts or logs) – hushed_voice May 18 '18 at 10:27
-
-1
You can do this. First hardcode the String as follows.
Log.d(LOG_TAG, "hardcoded string");
Now put the cursor top of that String (harcoded string) and press ALT + ENTER. It will show the option to Extract String resources.

Parinda Rajapaksha
- 2,963
- 1
- 36
- 40
-1

Xu Huafu
- 19
- 2
-
https://stackoverflow.com/questions/36938055/is-there-a-way-to-extract-a-string-with-an-automatically-generated-resource-name – vm345 May 18 '18 at 11:09