当前位置:网站首页>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: ..... LoginButtonWhen 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边栏推荐
- From "zero sum game" to "positive sum game", PAAS triggered the third wave of cloud computing
- Persisting in output requires continuous learning
- Redis installation under windows and Linux systems
- do{}while()的妙用
- Detailed pointer advanced 1
- [redis foundation] understand redis persistence mechanism together (rdb+aof graphic explanation)
- How are integer and floating-point types stored in memory
- Srs4.0+obs studio+vlc3 (environment construction and basic use demonstration)
- [combinatorics] combinatorial identities (sum of variable terms 3 combinatorial identities | sum of variable terms 4 combinatorial identities | binomial theorem + derivation to prove combinatorial ide
- String functions that you need to know
猜你喜欢

Semi supervised learning

工资3000,靠“视频剪辑”月入40000:会赚钱的人,从不靠拼命!

《微服务设计》读书笔记(下)

子类隐藏父类的同名函数

Break through 1million, sword finger 2million!

UnityShader——MaterialCapture材质捕捉效果 (翡翠斧头)

Intelij idea efficient skills (III)

Nifi from introduction to practice (nanny level tutorial) - flow
![[proteus simulation] 74hc595+74ls154 drive display 16x16 dot matrix](/img/d6/3c21c25f1c750f17aeb871124e80f4.png)
[proteus simulation] 74hc595+74ls154 drive display 16x16 dot matrix

Microservice - declarative interface call openfeign
随机推荐
Slam learning notes - build a complete gazebo multi machine simulation slam from scratch (II)
From "zero sum game" to "positive sum game", PAAS triggered the third wave of cloud computing
WinDbg分析dump文件
[web security] - [SQL injection] - error detection injection
Creation and destruction of function stack frames
[redis foundation] understand redis master-slave architecture, sentinel mode and cluster together (Demo detailed explanation)
相同切入点的抽取
Low level version of drawing interface (explain each step in detail)
“用Android复刻Apple产品UI”(2)——丝滑的AppStore卡片转场动画
Redis在Windows以及Linux系统下的安装
Microservice sentinel flow control degradation
Pandora IOT development board learning (HAL Library) - Experiment 5 external interrupt experiment (learning notes)
远程文件包含实操
【Proteus仿真】8×8LED点阵屏仿电梯数字滚动显示
C language brush questions ~leetcode and simple questions of niuke.com
利用MySQL中的乐观锁和悲观锁实现分布式锁
pycharm错Error updating package list: connect timed out
[proteus simulation] 74hc595+74ls154 drive display 16x16 dot matrix
Q2 encryption market investment and financing report in 2022: gamefi becomes an investment keyword
Backtracking method to solve batch job scheduling problem