Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tab key not working in Android Studio

I installed the Android Studio version 0.8.0 and my TAB key in my keyboard does not insert an actual tab in the editor window of Android studio. But my TAB key in general works fine.

Someone kindly help as i am not able to figure this out. Thanks.

like image 532
Vijay Avatar asked Jul 21 '14 20:07

Vijay


People also ask

Why tab button is not working in VS code?

You have enabled the Tab Moves Focus -mode. Press Ctrl + M to disable the mode. After that your Tab -key indents your code again.


2 Answers

File > Settings > Project Settings > Code Style - Java

Use tab character
If this check box is selected, tab characters are used: On pressing the Tab key For indentation For code reformatting When the check box is cleared, IntelliJ IDEA uses spaces instead of tabs.

Smart tabs
If this check box is selected, IntelliJ IDEA inserts tabs for indentation and reformatting, but fine alignment to a necessary column is done only via spaces without replacing them with tabs. This is done in order to preserve visual representation of the source code, when the tab size is changed.

If this check box is cleared, only tabs are used. This means that a group of spaces that fits the specified tab size is automatically replaced with a tab, which may result in breaking fine alignment. The Smart Tabs check box is available if the Use Tab Character check box is selected.

Tab size
In this text box, specify the number of spaces included in a tab.

You may also need to go to File > Settings > Project Settings > Code Style. XML if the Android xml is giving you the same issue.

http://www.jetbrains.com/idea/webhelp/code-style-java.html

like image 81
Stephan Branczyk Avatar answered Sep 19 '22 10:09

Stephan Branczyk


File > Settings > Project Settings > Code Style

And make sure that

  1. Use tab is checked under Code Style
  2. Use tab under Code Style - Java is checked also

enter image description here

Preferably you check "detect and use file indentations for edit" to avoid noise.

Use tab character : Code Style - Java

like image 26
M'hamed Avatar answered Sep 19 '22 10:09

M'hamed