摘要:
public static boolean checkDate(String date,String format) { DateFormat df = new SimpleDateFormat(format); Date d = null; try{ d = df.parse(date); }catch(Exception e){ //如果不能转换,肯定是错误格式 return false; } String s1 = df.... 阅读全文
摘要:
Map map = (Map) result; // Map_Msg 输出map信息 Set key = map.keySet(); for (Iterator it = key.iterator(); it .hasNext();) { String s = it.next(); Log.d("MainActivity", s + ":" + map.get(s));// 这里的s就是map中的key,map.get(s)就是key对应的value。 ... 阅读全文
摘要:
// checkEmail判断邮箱格式 public boolean checkEmail(String email) { Pattern pattern = Pattern .compile("^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\\.([a-zA-Z0-9_-])+)+$"); Matcher matcher = pattern.matcher(email); if (matcher.matches()) { return true; } return false; } 阅读全文
摘要:
// checkPhone判断手机号格式 public boolean checkPhone(String phone) { Pattern pattern = Pattern .compile("^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$"); Matcher matcher = pattern.matcher(phone); if (matcher.matches()) { return true; } return false; } 阅读全文
摘要:
利用复选框勾选---显示/隐藏登录密码(例如 电脑无线密码查看)【MainActivity.java】package com.example.test; import android.os.Bundle;
import android.app.Activity;
import android.text.InputType;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
impo. 阅读全文