Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restrict EditText to accept only Urls in Android

Tags:

android

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

like image 558
Android_programmer_camera Avatar asked Dec 22 '22 18:12

Android_programmer_camera


2 Answers

Open the Properties of your EditBox. Property InputType offers you a list of checkboxes, and one of them is textUri.

like image 114
Zelimir Avatar answered Mar 06 '23 04:03

Zelimir


It is also working with EditTextPreference although is not shown as property.

like image 29
Miquel Avatar answered Mar 06 '23 02:03

Miquel