import android.text.TextUtils;
import android.util.Patterns;
if (TextUtils.isEmpty(url)) {
Toast.makeText(this,"URL 不能为空~", Toast.LENGTH_SHORT).show();return false;
}
if (!Patterns.WEB_URL.matcher(url.toString()).matches()) {
Toast.makeText(this,"URL 非法,请输入有效的URL链接:"+url, Toast.LENGTH_SHORT).show();
return false;
}