Android studio 3.5 refactor issue

Sagar Kacha picture Sagar Kacha · Aug 21, 2019 · Viewed 9.4k times · Source

I just updated my studio with android studio 3.5 and now when I am trying to refactor AndroidManifest.xml file and it is refactoring my all app permission to the bottom of my file.

Have any one faced this issue? Is there any solution for this refactoring issue?

Before refactor:

enter image description here

After refactor:

enter image description here

It is applicable to my all project files.

Why it matters:

enter image description here

Answer

Birju Vachhani picture Birju Vachhani · Aug 21, 2019

You just need to set xml layout for Android applications from the settings.

Follow this steps:

1. Go to Android Studio > Preferences. For Windows, go to File > Settings.

enter image description here

2. Search for xml in search bar.

enter image description here

3. Under code style section, select xml tab.

enter image description here

4. In the top right corner, click on set from... and under predefined style, select Android

enter image description here

5. Click on Apply and try to refactor.