The Android EditText cursor is displayed at the end of the question.

demand

  1. EditText does not automatically gain focus (no cursor display) when entering the page
  2. when you click on the EditText area for the first time, the cursor appears at the end, and a soft keyboard appears
  3. Click EditText for the second time to specify the location, the cursor moves to the specified location, and the user edits

Code

  • layout

    
    <EditText android:background="@null" />
    
</RelativeLayout>

effect

  • implements requirements: 1
  • the first time you click on the EditText area, the keyboard displays, but the cursor position is where the user clicked, not at the end, unless the user clicks at the end.

question

  • how to implement requirements: 2
Mar.14,2021

problem has been solved

the key point of this question is the timing of the setSelection () method

Let's talk about how to solve it first

  • you don't need to make any extra settings in the layout
  

EditText has a setSelection method that should meet your needs

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a15b-2c1c9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a15b-2c1c9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?