Say I type the following field
field = "I am field";
In Eclipse as soon as I place the mouse on field it shows me a list of options from which I can select create local variable field.
In Android Studio, the lightbulb is a headache for me. Sometimes it appears quickly, sometimes it takes forever to appear.
Is there a way to force it to appear?
Are you talking about using Alt + Enter?
This link might help:
https://www.jetbrains.com/idea/help/keyboard-shortcuts-you-cannot-miss.html
Pressing Alt + Enter results in the drop-down menu with correction options in this case:
In the Android studio Settings/Keymap "shortcut Ctrl+Alt+S"
search for usage of "Alt + Ent" as below image if its not assigned for any action plz go for No. 2
Android studio shortcuts
In the Android studio Settings/Editor/Intentions.
Check whatever you want to show Intention in are checked or not as below photo
Intention
Double check no.1 is working fine and you found usage of "Alt + Ent" shortcut
[You can find the solution on official Jet brains website]
Intellij IDEA keyboard shortcuts
Intention actions
Try putting the cursor right next to the last letter of the class/method you want to edit, in other hand what worked for me in Android Studio is to use the bar on the right side, 'Outline' and from there get to the part you want to edit and use the tools from Outline or by right clicking on the method that appears in the tree drop down.
Related
Wherever your carret on a name that you want to change is
if you call for autocomplete (ctrl + space)
you will get a new full name instead of the only the part after carret(which is needed in this example)
The only possible way to choose another name in a clean way is to place carret at the end of the previous name
but when you want to change a name from the middle of the previous name
you have no choice other than accept the suggested name
and then delete the residue text from the previous name
Comparing previous text with new selected text from autocomplete suggestion box is implemented on many code editors. Is there any specific reason that Android Studio team decided to not to implement this feature? or may be this feature exist but is turned off by default for some reason and if this is the case how could we turn it on?
Just use TAB instead of ENTER to autocomplete changing the old value. It also works for methods.
Is there any way that I can view my print statements in android studio without displaying the time and directory? It's extremely distracting and hard to debug when that text is taking up so much space.
In the Android Monitor view in Android Studio (tested on Version 1.3), in the vertical toolbar inside the "logcat" tab, you will find a gear-shaped toolbar button. Click that, and you will get a "Configure LogCat Header" dialog with checkboxes to allow you to toggle on and off various pieces of what gets displayed:
Uncheck the items that you do not want (e.g., "Show time"). Note that LogCat does not show any "directory" except with respect to something you log yourself. My guess is that by "directory" you are referring to the package name.
This does not appear to affect existing messages, but should affect any future ones appended to the LogCat transcript.
You should use Log.d(tag, message). See here for the documentation.
try to use Log.d("message to show in log console")
I hate when I try to open the declaration of a layout and Eclipse redirects me to the R file, which is the same as nothing. Is there a keyboard shortcut for it to take me to the layout file. I know if you click on it with CTRL it gives you this option on a pop-up, but I hate using the mouse. I can't find this on the keybinding section. There's just plain "open declaration" which I have already changed because it was a horrible F3 by default, but this usually takes you to the R file
Well there is a mouse shortcut - Just hold down CTRL and hover over the id you want to see. You'll get two options, one for R.java and other to open the declaration. Choose the second one
EDIT:
Sorry, completely missed the part where you dont like the mouse use. Well I dont think there is any other way, and I see a bug/feature request here https://code.google.com/p/android/issues/detail?id=53536 reported specifically asking for this, so I wouldnt think another way exists other than either using the mouse or using the keyboard to highlight the particular item of interest and using Ctrl+Shift+R to get the menu and pressing Enter but like you mention this wouldnt work for something like R.id.foo . Wish someone from Google/Eclipse could comment on the bug/feature request.
If you CTRL + Shift + r : you can open any resource.
Using this with any text selected will pre-populate the open resource dialog with the text you selected. After that you should be able to find the file you want very quickly and double click it to open (or use down arrow and enter for openting without using a mouse).
Hope this helps.
I don't know why Webview still displayed tooltip text after it finished. In detail, This is the test case:
step 1: I press any column and simultaneously the chart display tooltip about column's info, right. But, In addition, the "copy" of tooltip is displayed beside the original one. I don't know why and how the "copy" existed.
step 2: Look at Highchart. After tooltip down, the "copy" did not disappear. why not ?
(I using Android OS version 2.2.1)
Thank you so much!
Eclipse Display Window doesn't work I can't run anything there.
For example I am trying to do this in the Display view window:
System.out.println("test")
But nothing happens, and when I looked in Eclipse documentationa and in the internet I found that the j icon on the upper right corner of the Display window should be active after I highlight the line of code or I can right click after I highlight the code and see the option to execute the code. but nothing is working.
Please help.
Try highlighting the text that you typed into the display window. You might be able to execute it once you do that.
This is because Display is used only when the code is being debugged. Put a Breakpoint in the code and while the process stops there, use Display to execute your code. It must work.
I am assuming that Consol Window is not opened in your eclipse. Just follow this steps,
Go to Window Menu
Select Show View
Select Consol ( or shortcut key is Alt+Shift+ Q C )
Just select the command like:
System.out.println("test")
and press Ctrl+U or right click on highlighted text and select execute. It will work.