-4

How can I extract string resource directly from Java class which suggest key itself, as we do from xml.

Khemraj Sharma
  • 52,662
  • 21
  • 188
  • 195

3 Answers3

2

Click ctrl+shift+a and type intensions and select the first item,Or click file-> settings -> Editor ->intensions. Enable extract string resources.

enter image description here

hushed_voice
  • 2,580
  • 1
  • 26
  • 51
-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,556
  • 1
  • 29
  • 37
-1

Just press alt + enter above the string.Same as in layout. enter image description here

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