Vijay
Vijay

Reputation: 435

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.

Upvotes: 6

Views: 4347

Answers (2)

M'hamed
M'hamed

Reputation: 2598

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

Upvotes: 5

Stephan Branczyk
Stephan Branczyk

Reputation: 9375

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

Upvotes: 7

Related Questions