Limit EditText to only accept Urls in Android

I am writing an application in which I need to restrict EditText to accept only URLs. How can this be done in Android?

+4
source share
2 answers

Open the properties of your EditBox. The InputType property offers you a list of checkboxes, and one of them is textUri .

+10
source

It also works with EditTextPreference, although it does not display as a property.

+1
source

Source: https://habr.com/ru/post/1337912/


All Articles