raven
raven

Reputation: 11

Can't auto complete in XML files in Android Studio

Is there any way to auto complete in XML files in Android studio? Eg: When I start typing RelativeLayout, I want Android studio to recognize it and give me a bare-bones prototype that I can just fill in. Is there any way to enable this?

I checked other answers and my power save mode is off and I'm not using any external libraries.

Upvotes: 0

Views: 5048

Answers (5)

Wenodh
Wenodh

Reputation: 1

reset your android studio (or) find .AndroidStudio(version) in your system in that config will be there delete it and reopen android studio it will ask default settings

Upvotes: 0

Poutrathor
Poutrathor

Reputation: 2059

I finally notice it was only the current XML file I was working on which had the issue, and inside a relative layout that have been defined from the WYSWYG editor. Don't know why exactly, rewrite it and everything fine again.

Upvotes: 2

Ali Nem
Ali Nem

Reputation: 5570

If you cannot use autocomplete in any xml, the working solution is here. However, if the problem is only with some xml files, you may have used custom views in them, where autocomplete will not work. The workaround is to temporarily change your custom view's name to its original android view and use autocomplete inside, and then revert the view to its custom name.

Upvotes: 1

Faraz Baig
Faraz Baig

Reputation: 64

You can check these from preferences.

Settings(Preferences in mac)->Editor->Code Completion

Please double check power safe mode too. it should be off

Upvotes: 0

Claudiu
Claudiu

Reputation: 285

You can try File -> Invalidate Cache/Restart. That did it for me.

Upvotes: 1

Related Questions