Common operation examples of EditText for Android programming

This article describes the common operations of EditText in Android programming. Share with you for your reference, as follows:

1. Get the text selected by the cursor

2. Set the position of the cursor in the input box

When writing an application, if we want to position the cursor to a certain position, we can use the following methods:

The code text. Length () is the position you want to set. Here it is set to the end of the text.

3 insert a string at the specified position

For more Android related content, readers who are interested can view the special topics of this site: introduction and advanced tutorial of Android development, summary of Android view skills, summary of activity operation skills of Android programming, summary of skills of operating SQLite database for Android, summary of skills of operating JSON format data for Android, summary of operating skills of Android database Summary of Android file operation skills, summary of SD card operation methods for Android programming development, summary of Android resource operation skills and summary of Android control usage

I hope this article will help you in Android programming.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>