I'm wondering why a shortcut combo Alt+Shift+A, S does not work (S at the end is needed because of a conflict with another shortcuts). After Alt+Shift+A the options dialog appears, but after clicking S nothing happens. It's annoying to use the mouse for such an operation so I would love to have a solution. The other questions I've looked for didn't help.
Thanks!
You have to have the string highlighted first. Once it is highlighted, performing the shortcut Alt+Shift+A;S should bring up the prompt for extracting an Android String. You can also use Ctrl+1, and then choose the option from that menu.
Related
The only way I have found to show the error of an underlined piece of code is to hover it with the mouse.
What is the keyboard shortcut to achieve this? (when the cursor is on the line in error)
On Mac that's Command-F1 (in the menu bar it's View -> Error Description). I think that's Control-F1 on Windows.
You should try using Alt+Enter key. This will recommend you the available solution for your error.
Also try using Ctrl+F1 it will give you a detailed information for your error.
P.S. these shortcuts are for Windows.
F2 is shortcut key to jump on next error line
please note that cursor must be in java file for this to work.
In Eclipse, I can put my cursor on a method name and hit ctrl-space and I get a list of available template proposals.
In Android Studio, when I'm typing a method name and open paren, I get a list of template proposals, but afterwards, how do I see the list again? I've already got show quick doc on mouse move, but that only shows the method signature I selected at first. I want to see alternatives to what I selected the first time through.
How do I show alternative method signatures, aka alternative template proposals?
EDIT:
Thanks to AndroidMechanic for answering Ctrl-P.
Here is what it looks like in Android Studio:
Here is what it looks like in Eclipse: . Notice that you're presented with the documentation in Eclipse, which I find helpful. But Ctrl-P gets me most of the way there.
In android studio to see all method overloads click inside the parenthesis and hit Ctrl + P. This will show you the different combinations you could pass as parameters to a method.
Using the latest version of Android Studio.
Once you type the function name and open brackets, AS would automatically display hint with variable type and name (which is really handy). But sometimes it would just disappear.
Does anyone know the keymap (shortcut) that would trigger it to pop again? (haven't found one in AS options, may be I missed one). In particular, I'd like to know the name of the corresponding shortcut so that I can find it through the Preferences screen and update the assigned keys if necessary.
The command name is "Parameter Info".
On Mac, it's assigned to Command+P by default.
On Windows, it's assigned to Ctrl+P by default.
And It's form View menu, called Parameter Info. There is the shortcut on menu.
To display a dropdown version of all the available parameters, you can use Ctrl + Space to show a dropdown list.
When editing android xml files.
IntelliJ allows me to complete android:screenOrientation by typing a:sc then I get my tag first in list.
In Eclipse, I have to type android:sc before I get my tag on top. If I type a: in Eclipse it empties list.
Is there a workaround or setting?
You can type sc only and press Ctrl+space.
Eclipse will suggests you the list of tags that starts with android:sc.
No need to type android:s to get the tags which starts with s.
this method used to work for me.
But for some reason when I press Ctrl+Space now, eclipse auto complete without popping the proposal window, and without understanding the context.
(if i'll type for example si and press Ctrl+Space eclipse will complete the word to a word starting with si instead of suggesting android:textsize as it used to do)
Sometimes when I'm working with my android projects, and hook up my phone, the logcat in Eclipse starts to report EVERYTHING that's happening on my phone, not just the stuff relative to the project I'm working on. It only does this sometimes though.
How do I stop it from showing everything and just show the things relative to my project?
EDIT:
I forgot to say i already know about filters, sorry. I was just wondering why sometimes eclipses logcat shows everything my phone is doing, while other times it only shows what's relative to the project i'm currently working with when running it on the phone.
I forgot to say i already know about filters, sorry.
Then it is because you have a filter selected and/or eclipse has encountered an error and is just not showing everything it should be.
First Answer
Next to your logcat window should be a Filter window. Create a filter there. Then select the filter by clicking the filter you have made or was put there automatically by eclipse.
You can filter on several things.
Most people will create a static string in their Main Activity/Service containing the application name. Use this static string as your TAG for all of your Logs. Then you can filter on this string you put for the static string.
Also, right clicking in the logcat window will bring up a filter dialog.
You can click on the session filter (left)
Use
Log.d("key","value");
Log.d("key1","value");
Log.d("key2","value");
Log.d("key2","value");
If you want to see only key1 messages ,then go to Logcat
click on add new logcat filter at top left corner(green color + symbol)
then a dialog box will be shown
then a dialog box will be shown, in that write Filter Name ie anyname
and in , by Log Tag write key1 and click on ok button.Now you will see a new filter on left side of your logcat
click on that,you will get only key1 messages
I could fix this by selecting my app in the DDMS-view.
It is important to select the app and not only the device. Latter will only create this useless "(Session-Filter)"
And this happens "sometimes" quite like the author asked for, i think if you change your mobile phone or just disconnect it.
http://developer.android.com/tools/debugging/ddms.html#logcat
You can also setup your own custom filter to specify more details such as filtering messages with the log tags or with the process id that generated the log message. The add filter, edit filter, and delete filter buttons let you manage your custom filters.
Use filters to define what you want to look at.
If you are using Eclipse, when viewing the LogCat view, there is a little green "+" button in the upper right corner. This will allow you to create a filter. Simply give your filter a name and input the TAG it should filter by.
If you are developing with Eclipse creating a log filter is what you are looking for.
If you are using logcat through adb from the command line: Filter LogCat to get only the messages from My Application in Android?