In Android Studio, Alt + Enter > "Extract String Resource" in a java file will open the following window:
Please note that the Resource name field is blank. However, the window will be like the following for a layout XML file:
Please note the Resource name field is filled automatically.
How can the Resource name field be filled with an automatically generated name for java files too?
It thought the Resource name was filled automatically for all types of files before the current version of Android Studio (2.1), but I could be wrong.
[edit] 2018-05-29: I want to emphasize the question is about "automatically generated resource name", not about whether one can extract a hard-coded string. Extracting a hard-coded string from a java file has always been available, but the automatic name generation is not there.