当前位置:网站首页>EditText request focus - EditText request focus
EditText request focus - EditText request focus
2022-07-03 16:05:00 【Rich in starch】
problem :
I am designing a login page as: I am designing a login page :
UserName: .....Password: ..... LoginButton
When the activity starts, I want the focus to go to "UserName" textbox and the keyboard to appear. When the activity starts , I want to focus on “ user name ” Text box and display keyboard .
I am using the following code: I am using the following code :
boolean checkFocus=user.requestFocus(); Log.i("CheckFocus", ""+checkFocus); if(checkFocus==true) { InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); mgr.showSoftInput(user, InputMethodManager.SHOW_IMPLICIT); }
I don't understand where to write this code to make the keyboard appear when the activity starts and focus is on the "UserName" editText box. I don't know where to write this code so that the keyboard appears at the beginning of the activity and the focus is “ user name ”editText On the frame .Can anyone please guide me? Can anyone guide me ?
Solution :
Reference resources : https://stackoom.com/en/question/XtON边栏推荐
- 用同花顺炒股开户安全吗?
- Microservice - Nacos registration center and configuration center
- 用通达信炒股开户安全吗?
- 《天天数学》连载56:二月二十五日
- Microservice API gateway
- 深度学习之三维重建
- Reading notes of "micro service design" (Part 2)
- Reflection on some things
- Salary 3000, monthly income 40000 by "video editing": people who can make money never rely on hard work!
- 远程文件包含实操
猜你喜欢
随机推荐
How can technology managers quickly improve leadership?
Function introduction of JMeter thread group
Expression of request header in different countries and languages
Redis高可用与持久化
Jmeter线程组功能介绍
The difference between RAR and zip files
Principles of several common IO models
关于网页中的文本选择以及统计选中文本长度
Problems of CString in multithreading
Q2 encryption market investment and financing report in 2022: gamefi becomes an investment keyword
“用Android复刻Apple产品UI”(2)——丝滑的AppStore卡片转场动画
Three dimensional reconstruction of deep learning
Detailed explanation of string function and string function with unlimited length
Microservice sentinel flow control degradation
Large CSV split and merge
【Proteus仿真】8×8LED点阵屏仿电梯数字滚动显示
Colab works with Google cloud disk
Nifi from introduction to practice (nanny level tutorial) - flow
Distributed task scheduling XXL job
Mongodb installation and basic operation