当前位置:网站首页>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边栏推荐
- [combinatorics] combinatorial identities (sum of variable terms 3 combinatorial identities | sum of variable terms 4 combinatorial identities | binomial theorem + derivation to prove combinatorial ide
- Driver and application communication
- How can technology managers quickly improve leadership?
- "Remake Apple product UI with Android" (3) - elegant statistical chart
- [list to map] collectors Tomap syntax sharing (case practice)
- do{}while()的妙用
- 《天天数学》连载56:二月二十五日
- Create gradle project
- A Fei's expectation
- Nifi from introduction to practice (nanny level tutorial) - flow
猜你喜欢
《微服务设计》读书笔记(下)
Microservices Seata distributed transactions
远程文件包含实操
Colab works with Google cloud disk
Remote file contains actual operation
[list to map] collectors Tomap syntax sharing (case practice)
Asemi rectifier bridge umb10f parameters, umb10f specifications, umb10f package
Low level version of drawing interface (explain each step in detail)
初试scikit-learn库
VS2017通过IP调试驱动(双机调试)
随机推荐
How idea starts run dashboard
Principles of several common IO models
Intelij idea efficient skills (III)
[系统安全] 四十三.Powershell恶意代码检测系列 (5)抽象语法树自动提取万字详解
嵌入式开发:避免开源软件的7个理由
Rk3399 platform development series explanation (WiFi) 5.54. What is WiFi wireless LAN
Using optimistic lock and pessimistic lock in MySQL to realize distributed lock
2022年Q2加密市场投融资报告:GameFi成为投资关键词
App mobile terminal test [5] file writing and reading
Microservice - fuse hystrix
"Remake Apple product UI with Android" (2) -- silky Appstore card transition animation
Persisting in output requires continuous learning
Asemi rectifier bridge umb10f parameters, umb10f specifications, umb10f package
Seckill system 2 redis solves the problem of distributed session
Wechat payment -jsapi: code implementation (payment asynchronous callback, Chinese parameter solution)
Go语言自学系列 | golang中的if else if语句
找映射关系
Use percent sign in CString
Microservice API gateway zuul
请求头不同国家和语言的表示