7

Where can I find the setting for automatically adding the closing tag in layout XML in Android Studio? For example, if I select TextView from suggestions, it should automatically close it with /> .

enter image description here

I used to get the ending tag automatically, but after updating Android Studio, I am not getting it anymore. I tried searching in Editor > Code Style > XML, but didn't find any relevant setting.

enter image description here

I am on Android Studio 3.5 RC 3.

Pang
  • 9,564
  • 146
  • 81
  • 122
Manohar
  • 22,116
  • 9
  • 108
  • 144

3 Answers3

2

Could it be this one?

Android Studio Settings

Insert closing tag on tag completion and Auto-close tag on typing </ ?

For what is worth, mine closes automatically.

Martin Marconcini
  • 26,875
  • 19
  • 106
  • 144
1

I've both AD 3.4.2 and 3.5 RC 3 installed on my system. XML issues like this are only happening on 3.5+ versions. I've looked up at open issues and came to know that 3.5 causing many issues like No auto tags after completion, hangs/freezes during autocompletion and many more.

Ali Ahsan
  • 985
  • 11
  • 16
  • ya might be a bug , I cannot find any setting . I will accept answer once I can confirm if it's a bug . – Manohar Aug 15 '19 at 13:28
0

The base problem: Observe the current code style (Schema) it's got changed from default style to project style when you rebuild your project, I don't know why this happened!

A proper fix for this, is setting the current style to Default IDE:

enter image description here

Ibrahim Ali
  • 1,237
  • 9
  • 20