Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android EditText specifically for URL [duplicate]

Tags:

java

android

I would like to make an EditText field in an Android application asking the user to give a URL.

I noticed when you type a URL in the "Internet" application, a keyboard that has "www." and ".com" buttons appears .

How can I make my EditText pop that keyboard instead of the regular one?

like image 990
user3502280 Avatar asked Apr 22 '14 03:04

user3502280


People also ask

What is edittext in Android?

In android EditText is a user interface control which is used to accept input from the user or to edit the text. EditText is nothing but a text field in HTML which accepts input.EditText is a sub class of TextView that configures itself to be editable. Check this android UI controls tutorial to know more about UI controls.

How to add edittextexample in Android Studio?

1 Create a new project in Android Studio and name it EditTextExample. Select File -> New -> New Project and Fill the forms and click "Finish" button. 2 Now Open res -> layout -> xml (or) activity_main.xml and add following code. ... 3 Now open app -> java -> package -> MainActivity.java and add the below code. ...

How to set text style of a edittext in XML?

textStyle : textStyle attribute is used to style the text of the EditText.There are three values for a textStyle attribute like normal, bold, italic .By default it is normal .If we want to use more than one value at a time we can use “|” operator. like bold | italic. Example code snippet for setting text style of a EditText in XML.

How to write url only in Android Studio?

This enables a user to user to write URL only. To create a new project in Android Studio please refer to How to Create/Start a New Project in Android Studio. Note that select Java as the programming language. Navigate to the app > res > layout > activity_main.xml and add the below code to that file.


1 Answers

You can use below code for EditText

 android:inputType="textUri"
like image 167
Sebastien Bianchi Avatar answered Nov 14 '22 22:11

Sebastien Bianchi