(1)EditText中保留小数点后两位;
解决方法: https://blog.csdn.net/yinzhijiezhan/article/details/46819261
/**
* 第一种方法
*/
num_et.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before,
int count) {
if (s.toString().contains(".")) {
if (s.length() - 1 - s.toString().indexOf(".") > 2) {
s = s.toString().subSequence(0,
s.toString().indexOf(".") + 3);
num_et.setText(s);
num_et.setSelection(s.length());
}
}
if (s.toString().trim().substring(0).equals(".")) {
s = "0" + s;
num_et.setText(s);
num_et.setSelection(2);
}
if (s.toString().startsWith("0")
&& s.toString().trim().length() > 1) {
if (!s.toString().substring(1, 2).equals(".")) {
num_et.setText(s.subSequence(0, 1));
num_et.setSelection(1);
return;
}
}
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
}
@Override
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
}
});
/**
* 第二种方法
*/
num_et2.addTextChangedListener(new TextWatcher()
{
public void afterTextChanged(Editable edt)
{
String temp = edt.toString();
int posDot = temp.indexOf(".");
if (posDot <= 0) return;
if (temp.length() - posDot - 1 > 2)
{
edt.delete(posDot + 3, posDot + 4);
}
}
public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {}
public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {}
});
}
(2) This Gradle plugin requires a newer IDE able to request IDE model level 3
解决方法:https://blog.csdn.net/qiutiandepaomo/article/details/78919069
(3) “买卖旺”app项目用小米MIX 2调试闪退
解决方法:换vivo x6d手机调式正常
(4)applicationId不同导致微信分享失败,以及applicationId和packageName的区别?
(5)process exit non-zero -1;
解决办法:删除build文件,重新编译运行即可;
(6)大图片手机卡住的问题
解答:上传的时候,对图片进行压缩处理;加载的时候,不使用开线程网络请求加载图片,而是使用volly网络框架加载图片;
(7) device supports but apk only supports
https://blog.csdn.net/qq_32452623/article/details/71076023
(8) 在用vivo x9手机运行程序时,出现“解析软件包时出现问题”的问题
解决:https://blog.csdn.net/wl521124/article/details/80558155
(9)编译、运行安装正常,打包出现(删除build文件夹,重新构建,编译)
Error:Execution failed for task ':app:mergeReleaseResources'.
java.lang.RuntimeException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1
命令行:gradlew :app:mergeReleaseResources –i
(10)editext软键盘问题
https://www.cnblogs.com/xuanwei-qingfeng/p/7445002.html
https://blog.csdn.net/u012523122/article/details/52101303