首先出现中文乱码会有好几种情况,我这里把所有需要设置的地方都列出来,我们可以一个个试试。
A.解决方式如下:
1、点击 Android Studio 右下角的 File Encoding UTF-8,在出现提示时点击 GBK;
2、在出现的对话框中点击 Reload -> Reload anyway,此时源代码乱码消失,出现中文;
3、点击 Android Studio 右下角的 File Encoding GBK,在出现提示时点击 UTF-8;
4、在出现的对话框中点击 Convert。
Build一切OK。注意顺序不能出错。
B.第二种
在bulid.gragle中加入下面的第三句代码
compileSdkVersion 10
buildToolsVersion "20.0.0"
android {compileOptions.encoding = "GBK"}
C.第三种
1.打开file,点击settings
2.点击editor下的file encodings
3.在这里设置编码方式