When using the autocompletion feature, I suddenly see every layout view ID twice. How can I only show each ID one time in the autocomplete popup?
Note, I am importing the activity_main.xml layout like this:
import kotlinx.android.synthetic.main.activity_main.*
Autocomplete two instances of each ID
Maybe doing a Clean and Rebuild would help (in the Build menu), or Invalidate Caches and Restart in the File menu.
But just so you know, Kotlin Android Extensions (including the synthetics you're using) is deprecated and unsupported, so it's possible you might see screwy behaviour like this in the tooling. You might just have to put up with it if you continue to use it - the recommended replacement is View Binding, and there's some info about it here (and how to migrate from synthetics) here
Related
I was wondering. Is there any possibility to change order of options after pressing Alt+Insert (New...) in Project Structure tab. I'm not sure if it's called Commander Popup, but I meant this:
I really want to have Kotlin File/Class as my first option. I was trying to change some options in Menus and Toolbars setting like this:
But unfortunately it changes nothing.
I know I can assign shortcut to generate new Kotlin File - but it feels like workaround.
after I've started using a new Windows 10 system and installed the latest version of Android Studio I've had some minor problems like missing attributes in the Layout Editor mode. I'm used to add some attributes through typing on XML edit, but as I tried to change the Font Family from a button using the Attributes side bar I couldn't find fontFamily anywhere! It wasn't in the textAppearance context and neither looking through the whole attributes list.
If I come to add the attribute by typing in XML it does appears on the side bar, but only and if I do that, otherwise I can't find it anywhere. I'm looking for a clue about this for some hours without any luck... anybody here nows anything about it?
The only thing I tried to "solve" this was renaming some folders like Cache, Compiler, Frameworks and some others at both, .android and .AndroidStudio3.3 folders. This didn't make the missing attributes show up.
fontFamily as it should be
Just ran into this when trying out Android Studio v3.4.1.
It turned out the default min SDK version was set to 15. Bumping it up to 16 made the attribute show up in the all the expected places!
I'm currently using Xamarin Studio and have a comfortable enough setup so that I can put my various pads (output, unit tests, solution tree, etc.) on different screens. I like it and I'd like it to stay the same wether I'm debugging, running tests or coding.
But right now, xamarin studio handles it himself and switches to the Debug view layout when debugging, which changes everything to their default (since I've never really changed it).
Is it possible to tell Xamarin Studio to either :
- Never switch layouts?
- Set which layout is used for each situation (and I would just use my custom layout)
I've tried deleting all layouts and XS just recreates them. No dice here.
I've tried switching to my layout when debugging, hoping it would remember "this is my debug layout now". No chance either.
And I'm hoping I won't have to change each separate layout, because first it'll take a stupid amount of time, and also because if I ever decide to make a change, i'd have to set it up over 5 different view layouts which is just ridiculous.
Note : I'm using the latest version of Xamarin of the stable channel.
So, does anyone know a way to keep one single layout for all situations?
Unfortunately, no, it is not possible with the current version of Xamarin Studio.
I read through both the preferences as well as the documentation. I even tried to create my own custom layout by navigating to "View" -> "Save Current Layout". Then I selected my new custom layout when I started a debugging session, hoping it would persist to the next one. But alas, the "Debug" view was chosen automatically.
This would probably be something you could bring forth as a suggestion of improvement to the Xamarin team. You can do so using their bugzilla.
I'm here today because I'm having an issue with Android Studio. I don't know if it existed on previous versions (I don't remember this being an issue, so I doubt it was a problem on a previous version), but currently I am using the Android Studio V2.1 Stable release.
My issue is that if I launch Android Studio (I happen to be on Windows, 64-bit Android Studio) and at the Start Screen/Page, I click Configure>Settings>Editor>Code Styles, and change the default parameters on any of the languages (XML, Java, HTML, etc.), the Default profile is copied to a new profile (Default(1)) and the new settings get applied to each profile.
If I Apply these changes and exit Android Studio, and launch back up and follow the same method...the settings have completely gone back to what they were before I changed them, with the exception of the Default(1) copy profile. But from my experience, Android Studio doesn't build new projects based on this Default(1) copy profile, it builds them on the Default profile. Which means all of my adjustments to using indents and not spaces, keeping indents on empty lines, etc. all do not get carried through to the actual project files, leaving me to have to go back into the settings with the project loaded up and change all of these parameters again. That's just asinine. Please tell me I'm missing something here and that there's a simpler way of achieving the ability to keep a code style template that I can use on all of my projects!
Perhaps it would be better to report or consult on this using the Android Studio feedback site. If that's the better option, I'm willing to do that too.
Thanks everyone!
What I do in that case is
Go to Preferences
Code Style
Select scheme you want
Click Settings cog
Click copy to project
Some OKs and then it works.
After selecting the code style that i want, opened the gradle.properties file in root folder of the project and deleted the following line
kotlin.code.style=official
deleting the above line, prevents the code style resetting to default.
Go to Preferences
Code Style
Set Scheme to Default [IDE]
Click restore defaults
The simplest way I found to reset the default settings is as follows:
In Android Studio, click on File.
Settings (Ctrl + Alt + S)
Under Editor in settings
Select Code Style
Next to Scheme: select the three dots to access the scheme options ()
Select Restore Defaults
A Confirmation Dialog Box will be displayed to confirm if you want to revert back to
the default settings.
I know that for css, html, and gsp files you can just refresh the browser without having to rebuild the application in order to see your updated changes. If you're stepping through code in debug mode, and make a change for a groovy or class file, do you have to rebuild the application in order to see the change?
IntelliJ does not update the classes in your running application automatically. You need to compile them manually (this will not be a full project rebuild - IntelliJ will build the project incrementally and compile only the changed classes and the code that depends on them), and then IntelliJ will offer you to reload the changes (which may fail if the changes you made aren't supported by the Java hotswap).
Note that some Web frameworks may be able to reload the changed classes automatically, independently of whether you're running your code from IntelliJ or not.
Say you're stopped on a break point, and want to edit the source code of the method you're in. Make the edit, save it, then run > Reload Changed Classes. Then, in the debugger controls, Drop Frame. Without dropping the frame, you won't execute the your newly recompiled method body.
By default, there's no keybindings for these 2 commands, but you can create them via the KeyMap in the settings (ctrl + alt + s). Even better, you can make a macro that will execute both these commands for you.
I wish it was easier and automatic, like in eclipse, but oh well.