The preview of AndroidStudio cannot be displayed and the emulator cannot be called

 Hello, everyone, this is the second issue of the AndroidStudio code problem column. The preview button function of the xml interface in AndroidStudio has disappeared! Maybe inadvertently, you will find that when you finish writing the xml layout file, you want to see how the layout you wrote, but what is puzzling is that the preview mode display button of your xml interface is missing, which makes you finish writing 's layout interface cannot preview the effect, and now share how to solve this sudden problem!

The solution process is as follows:

the first method:

Click View on the toolbar at the top of the Androidstudio interface, then click ToolWindows and then click preview!

As indicated by the cursor, in addition, when performing this operation, go to the xml layout interface!

The second method:

Double-click on the current interface is shift, an interface will pop up at this time, and then enter preview in the search bar area!

Third method:

I have not used this method at present. I have heard my friends discuss it before. The specific steps are as follows:

Step 1: Go to any xml interface and click Design at the bottom left

Step 2: Click the Android API version above, change it to 26 or 25, in short, it should be smaller than the current API

Step 3: Click the triangle exclamation symbol on the left of Attribute, and the error preview will pop up.

Step 4: Click reflash in the pop-up error preview message, refresh the interface, and the preview will be successfully displayed again!

In addition, when we talk about the preview, let’s make an episode about the use of the emulator. As we all know, the emulator that comes with Androidstudio eats the CPU of the computer. From time to time, there will be problems such as freezing, black screen, and no display. Now college students generally use it when Night God simulator, but some students of this simulator may encounter problems that cannot be called, even if it is opened, but it cannot be displayed in Androidstudio, so I recommend several simulators such as mumu simulator, and at the same time for some students' simulators The methods that cannot be called are as follows:

1: Start Android Studio and third-party emulators;

2: Open the Terminal of Android Studio, use adb to connect, here is an example of connecting the "Night God Simulator";

3: After prompting that the connection is successful, it means that it is connected to the emulator.

Night God Simulator: adb connect 127.0.0.1:62001
Thunderbolt Simulator: adb connect 127.0.0.1:5555
Xiaoyao Android Simulator: adb connect 127.0.0.1:21503
Tiantian Simulator: adb connect 127.0.0.1:6555
Haima Play Simulator : adb connect 127.0.0.1:53001
NetEase MUMU emulator: adb connect 127.0.0.1:7555

If you click on adb show is not an internal command

Method 1: Enter the adb.exe file directory to execute
Method 2: Configure environment variables
Note: After android 2.2, adb.exe is placed on the
computer under the platform-tools directory of the SDK (right-click) → Properties → Advanced system settings → Advanced → Environment Variables can also be Windows Start Key + Pause Break → Properties → Advanced System Settings → Advanced → Environment Variables
Run again: adb connect 127.0.0.1:26944
Note: To modify the environment variables, you need to restart the Local window, and the instructions will take effect
today. That's it for the AndroidStudio code issues column, see you tomorrow! Follow if you like it!

Guess you like

Origin blog.csdn.net/Abtxr/article/details/123958372