Android examples for User Interface:EditText
valid EditText input for URL String
//package com.java2s; import android.widget.EditText; public class Main { public static String valid(EditText mEditText) { String http = "http://"; String https = "https://"; String textEdit = mEditText.getText().toString(); if (textEdit.contains(http) && textEdit.contains(https)) { return textEdit; }//from w ww. ja v a2 s. c o m else return http + textEdit; } }