I've looked at How to auto import the necessary classes in Android Studio with shortcut? but it doesn't help.
Ctrl+Alt+O does nothing.
When I press alt+enter I get the following:
I do not want this, I wish for it to appear as a normal import at the top of the file.
What are these shortcuts called in Android Studio? This program makes it complicated to edit such simple shortcuts.
I also have auto-imports, but it isn't working:
Finally after hours of trail and error the following settings is what fixed it:
Pressing Ctrl + Space on Mac will open a dialog to choose which library to import.
check this link for detail ans
https://stackoverflow.com/a/37362700/3288890
or
goto file -> setting select keymap and search for auto import and add keyboard short cut
Related
in Android Studio I see my classes on the left (Android-Tab) and the editor window with the open class file (SomeClass.java) on the right.
If I double click a class file in the Android-Tab, it gets opened and the focus switches to the class file. I can start writing immediately.
My problem is: If I select a class file in the Android-Tab and hit 'Enter', the class file opens but the focus is still in the Android-Tab and I can not start writing. I have to use the mouse/trackpad to click into the class file to switch the focus.
Is it possible to change the behaviour of Android Studio in that case?
I use Android Studio 2.3 beta 2 on OSX.
Thanks in advance
You can use Command(⌘)+Down Arrow(↓) to (Open | Switch)&Focus the class instead of pressing Enter which only (Opens | Switch) the class.
On Keymap you can find Jump to Source:
In Android Studio (IntelliJ) how do you execute a 'File Search' for a string within a Scope of files? Can Search Everywhere do this, I only see how to use it to search 'code', not 'files'
Example: Search for the string "Dummy Button" in the 'Workspace Scope'.
Expected Response: res/values/string.xml:line4
You can do it in two ways,
Goto Menu -> Edit -> Find -> Find in Path
Or use the shortcut,
ctrl+shift+f
In Android Studio,
On a Windows or Linux based machine use shortcut Ctrl + Shift + F to search any string in whole project. It's easy to remember considering Ctrl + F is used to search in the current file. So just press the Shift as well.
On OSX use the Command key instead of Ctrl.
Use Ctrl + F combination for Windows and Linux to search in current file.
Use Shift + Shift (Double Tap Shift) combination for Windows and Linux to search Project File of Project.
Command+Shift+F on Mac to find in path
In Android Studio 4.1 update, the combination for Mac users changed, now you should use Control + Shift + f.
Try this. Enter your string name in dialogue box after pressing ctrl+shift+f
Menu Bar->Edit->Find->Find in Path...
Press Two times Shift button and write in search box it will search in whole Android studio.
In my case, I accidentally checked the box of "File mask". So all xml files are not searchable in Find in Path. Maybe this can help you.
i am facing problem in android studio. In eclipse when i want to use class like Intent, then i write intent starting with lower case it give me suggestion box indicating class name Intent, but in android studio if i type intent starting with lower case it does not Provide Suggestion class name Intent.Thanks in advance.
In my case Ctrl + Space was overloaded by mac shortcuts. And even in the case, I disabled them, they conflict with Android Studio.
So, I gave them another keys and it solved the problem.
Go to the System Preferences -> Keyboard -> Shortcuts -> Input Sources and use new keys for them.
The problem is that Android Studio has different key binding than Eclipse, but you can set the key binding to be the same as in eclipse in android studio settings. Also by default ctrl + space is case sensitive in Android studio, you need to turn that off too.
Move to File -> Settings -> Keymap and change keymaps settings to eclipse so that you can use the short cut keys like in eclipse.
You can set 'Case sensitive completion' to 'None' in IDE Settings > Editor > Code Completion.
That should do it :)
File --> Settings --> Editor --> General --> Code Completion --> Case sensitive completion --> None
eclipse has display tool(window -> show view) in debug, I want to call variable or method name like eclipse so where is the display tool in android studio ??
please help, thanks
I think what you're looking for is the 'Evaluate Expression' window, which pops up with a ALT+F8 combo. Here is some more info.
Yes "Evaluate Expression" in Android studio is like the "Display view" in eclipse. In case you're not sure of the shortcut, Go to Run > Evaluate Expression.
Hope that helps
I am trying to add the Pinit button to my Android App. I have downloaded the SDK and copied the pinit-sdk-1.0.Jar into my Project/libs folder. I'm even able to make the necessary PinItButton import to my code. But for whatever reason, my XML isn't finding the Button widget, and so I tried to add it just using Java with this code:
LinearLayout ll = (LinearLayout)findViewById(R.id.pinterest_layout);
PinItButton pinit = new PinItButton(this);
ll.addView(pinit);
I know this is the correct way to add something using code because I tested it by adding a generic Button first. I run my project then, and it crashes on the line where I set up the PinItButton. This is the error that my logcat spat back at me:
07-22 01:19:52.160: E/AndroidRuntime(32367): java.lang.NoClassDefFoundError: com.pinterest.pinit.PinItButton
I believe that I'm understand what it is telling me, but what else should I be attempting then to create the PinIt button? Any help would be great. Thank you!
It was #Kai who helped me figure out my problem. I needed to check my libraries. I did that by going to project --> Properties --> Java Build Path --> Order and Export tab, then checking the library and clicking OK. My problem was then solved!