I know there's already a tool to check web address in Java. But I don't know why this logic does not work. The alert message does not go away even if the input is right. Thanks.
@Override
public void onClick(View view) {
    if(checkInput()){
        String email = getResources().getString(R.string.email);
        Intent i = new Intent();
        i.setData(Uri.parse("mailto:"));
        startActivity(Intent.createChooser(i, "Send mail..."));
    }else{
        AlertDialog alert = new AlertDialog.Builder(getContext()).create();
        alert.setMessage(getResources().getString(R.string.valid_input));
        alert.show();
    }
}
public boolean checkInput(){
        return (uri.startsWith("http:")&&!uri.equals(""));
}
 
     
    