I am using AS since 4 years. After last update I observed unexpected auto-formatting of XML layout (while typing and with Code -> Reformat Code too).
Here is an example:
When I started typing relative layout, it expanded start tag, width property, height property and closing tag in the same line.
Properties starts after indentation.
No space between views after reformat.
Question
Is this a feature in new AS? then how can I revert it back?
Did I change some setting? What setting should I modify to revert back? (I tried to find on google but could not find anything)
I am using
Android Studio 3.2.1
Build #AI-181.5540.7.32.5056338, built on October 8, 2018
Update
if you facing same issue with Android Studio 3.5 please check below article
Android Studio 3.5 Upgrade XML Reformatting Problems
Open File > Settings > Editor > Code Style > XML
Now in layout file make sure you have selected wrap attributes as Wrap always
Like below screenshot:
for me it's working
Open Settings > Editor > Code Style > XML > Arrangements
Click Set from... text
Select Predefined Styles > Android
Click Apply button
How do I modify the default settings to show the line number in AS 2.2?
Android Studio > Editor > General > Appearance: There will be a "show line number" checkbox for Mac
There's an easiest way...
Right clic in the left side bar of the Workspace area and choose Show Line Numbers (see pic example).
Enjoy coding!
When I open a Java file in Android Studio, the code editor automatically jumps to the last position my cursor was at when I closed the file. Is there a way to disable this 'feature'? I just simply want to go to the top of the file when I open a file...
It's Alt + Ctrl + Right/Left arrow.
You can change these shortcuts under:
File > Settings > Appearance & Behavior > Keymap > Main menu > Navigate > Back/Forward.
The same question was marked as "duplicate" even though it obviously was not a duplicate. At least it should be obvious to anyone who is familiar with configuring an editor. When you want to change the background color, you aren't talking about changing the whole theme, you are talking about changing the background color.
Is there a way to change only the background color in Android Studio editor?
Sorry, but I believe you all have this one wrong. To change the background of the editor goto File, Settings, Editor, Colors & Fonts and select General. You'll see an item called "Default text". On the right of the window you will see a checkbox for background. Click in the color window and choose whichever color you prefer. Now the entire editor window will show that color as the background.
go to : Android Studio > Preferences > Editor > Colors & Fonts > General
In Android Studio 3.2.1 Windows (latest version as of today - Nov 2, 2018), go to
File > Settings > Editor > Color scheme > General > Text-Default text. One can change foreground and background colors using the panel on the right.
One can change the bottom logcat panel colors similarly - go to
File > Settings > Editor > Color Scheme > Console Colors > Console (or log Console)
Yes it is. Open Settings (Preferences on a Mac) and under IDE Settings expand Editor, Colors & Fonts and select General. You'll see Background in a menu on the left side. Click on the checkbox next to it if it's not ticked already and then double click on the square filled with current background color to get the color picker.
AndroidStudio 3.3.2
1st step:
2nd step:
Android Studio 4.1.2 on Mac
File -> Preferences -> Editor -> Color Scheme -> General -> Text -> Default Text
None of the Answers above have correct info for Windows Android Studio 3.1.2.
On Mac, apparently this works: go to Android Studio > Preferences > Editor > Colors & Fonts > General, but we Windows folk don't have an Android Studio tab or option and Preferences isn't an option anywhere.
We have File > Settings > Editor. Here's the screen with the only conceivable next links to click highlighted:
But here's what I see when I click General. I can select this background:
But I can't live with that.
In Windows 7, AS 3.1.2 the menu sequence--File > Settings > Editor > Color scheme > General > Text > Default text--takes you to a screen where you can set the foreground and background colors via a "color circle" or by typing in your favorite RRGGBB code(s).
I was pleasantly surprised by how an error in an xml file showed up (and the current line):
I have opened up a android project but the xml file graphical layout is not being shown..I have searched on stack overflow and found that it can be fixed by clicking create in top right ..but it is greyed out and does not come up...even if i fill all the details of locale,editing config,change android API level to 2.2/3.0 ..The file opens in xml view..Screenshots are attached..
Can anyone let me know what is the problem and its solution.
If the answer is there somewhere on stack overflow..kindly provide the link..i will delete the question..i wasn't able to find the answer myself..
Open With > Android Common XML editor will not work.
The two tabs was missing because of the theme. Try to set your theme back to the default one. Eclipse > Preferences > General > Appearance > Theme combobox > Mac