Home » Android » Android Studio Refactor > Extract > Style Disabled

Android Studio Refactor > Extract > Style Disabled

Posted by: admin April 23, 2020 Leave a comment


I am trying to extract style in android studio 0.8.9 using the refactor option. But it seems to be disabled for some reason. I have tried cleaning and rebuilding the project just in case and even restarting Android Studio, but nothing seems to enable the extract style option.

Do let me know if anybody else is facing the same problem or is there a way to solve this ?
Screenshot image:

How to&Answers:

I had the same problem. Extracting styles is different in Android Studio:

You don’t need to select text and choose Refactor->Extract->Style, just choose the menu option With no text selected.

So, just click anywhere inside the ImageView element (Do not select any text). The refactor option should become available.


Works fine for me without selecting any code. To extract layout you need to select the whole layout not just a part of it.