General what shortcut keys, skills of the article also have a lot of. I’ve seen a lot of them. Android Studio Tips of the Day: Android Studio Tips of the Day: Android Studio Tips of the Day: Android Studio Tips of the Day

There are more than eighty Android Studio Tips of the Day. You can check out the full version. And it’s constantly updating the status. Very useful (remember to stay online safely.)

1.tools:attribute

If you need to see a preview of your written TextView with text in it. Then this is for you. Using ‘tools:something=”value “‘ will show up in the preview, but not when the software is actually running.

There are only two steps:

  • XMLNS: is added in the root layout tools = “[http://schemas.android.com/tools] (http://schemas.android.com/tools)”
  • Use the ‘tools:something=”value “attribute in the TextView

This is so useful!! I used to use Android :text = “XXX “every time I wrote a layout preview, and then had to delete it after the program was finished. Silly!!!!!!

toolsnamespace

2.Extract Resource

For example, if you write a String or dimen value in the layout file or code file instead of referring to the resource file, do I have to open the corresponding String. XML or dimen. XML file to add it, and then modify the layout file or code file to use the reference? The answer, of course, is NO.

Mac: Select that value and then the Option + Enter key selects Extract String/Dimension Resource.

Win: Alt + Enter select Extract String/Dimension Resource.

extractstring

3.Toggle between text/design mode

You can Control + Shift + left/right on OSX and ALT + Shift + left/right on Windows and Linux. To switch between Design viewing and Text editing

4.CamelHumps

To quickly switch between several uppercase words linked together, turn on the “CamelHumps “option in “Editor->General->Smart Keys”. On the Mac, it’s option+. “Alt” or “CTRL” on Win. (There will be a bug here, after enabling, for example, your variable name is several words, such as isSuccess, when you double-click to select this variable, you will find that it cannot be all selected, and then Success is selected.)

camelhumps

5.Close Others

When Android Studio has a lot of files open and you want to leave the current file and then Close other files, you usually right-click and select Close Others. All you really need is

Mac: Hold option down and mouse click on the close button for the file you want to keep, then everything else is closed

Win: hold down the Alt.

closeothers

6.The Navigation Bar

The navigation bar is the “breadcrumb” at the top of the IDE.

This indicates that your path is added to the current file, but you can also use it to navigate and/or take actions on files and folders.

You can navigate to the parent’s subfolder or find the sibling class

You can easily create new files using code generation shortcuts (CMD + N/ALT + insert)

In fact, you can do anything in the project view by right clicking

You can hide the navigation bar. Display by shortcut keys. You can make the Android Studio screen display more content.

navigationbar

7.Open Source in New Window

You can make the currently open file appear in a separate window.

Mac: Shift +F4

Win:shift+F4

opensourceinnewwindow

8.Override Methods

We might want to override a method of a parent class, but forget the name of the method for a moment.

Mac:control + o

Win:ctrl + o

overridemethod

9.Edit Regex

Description: Writing regular expressions in Java is difficult for a number of reasons:

You have to avoid backslashes;

To be honest, re is hard;

Look at number two.

What can an IDE do for us? Alt + Enter → Check regexp

checkregexp

10.The Switcher

Too many open files. How to switch files quickly?

Mac : control + tab

win: ctrl + tab