-4

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

Khemraj Sharma
  • 57,232
  • 27
  • 203
  • 212

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
  • 3,161
  • 3
  • 34
  • 66
-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

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