0

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.

Zoe
  • 27,060
  • 21
  • 118
  • 148
raven
  • 11
  • 1
  • 2

5 Answers5

2

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.

Zoe
  • 27,060
  • 21
  • 118
  • 148
Poutrathor
  • 1,990
  • 2
  • 20
  • 44
1

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

Amit Joki
  • 58,320
  • 7
  • 77
  • 95
Claudiu
  • 275
  • 1
  • 3
  • 9
1

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.

Community
  • 1
  • 1
Ali Nem
  • 5,252
  • 1
  • 42
  • 41
0

You can check these from preferences.

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

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

Amit Joki
  • 58,320
  • 7
  • 77
  • 95
Faraz Baig
  • 66
  • 2
0

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

Wenodh
  • 1