当前位置:网站首页>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边栏推荐
- Getting started with Message Oriented Middleware
- Detailed explanation of four modes of distributed transaction (Seata)
- App mobile terminal test [5] file writing and reading
- 请求头不同国家和语言的表示
- 《微服务设计》读书笔记(上)
- Please be prepared to lose your job at any time within 3 years?
- Vs2017 is driven by IP debugging (dual machine debugging)
- Principles of several common IO models
- 高等数学(第七版)同济大学 习题2-1 个人解答
- Client does not support authentication protocol requested by server; consider upgrading MySQL client
猜你喜欢

Unity功能——Unity离线文档下载及使用

Microservice - declarative interface call openfeign

String functions that you need to know

Secsha system 1- login function

MB10M-ASEMI整流桥MB10M

Stm32f103c8t6 firmware library lighting
![[redis foundation] understand redis persistence mechanism together (rdb+aof graphic explanation)](/img/68/3721975cf33fcfacc28dc4d3d6a5ca.jpg)
[redis foundation] understand redis persistence mechanism together (rdb+aof graphic explanation)

Microservice - Nacos registration center and configuration center

About text selection in web pages and counting the length of selected text

Mixlab编辑团队招募队友啦~~
随机推荐
“用Android复刻Apple产品UI”(2)——丝滑的AppStore卡片转场动画
QT use qzxing to generate QR code
Go language self-study series | golang switch statement
uploads-labs靶场(附源码分析)(更新中)
子类隐藏父类的同名函数
[proteus simulation] 74hc595+74ls154 drive display 16x16 dot matrix
About text selection in web pages and counting the length of selected text
大csv拆分和合并
通过进程PID获取可执行文件路径(QueryFullProcessImageName)
Famous blackmail software stops operation and releases decryption keys. Most hospital IOT devices have security vulnerabilities | global network security hotspot on February 14
Principles of several common IO models
Redis installation under windows and Linux systems
Expression of request header in different countries and languages
Creation and destruction of function stack frames
Pandora IOT development board learning (HAL Library) - Experiment 5 external interrupt experiment (learning notes)
Function introduction of JMeter thread group
Location of software installation information and system services in the registry
Brush questions -- sword finger offer
Redis高可用与持久化
Effect of ARP package on FTP dump under vxworks-6.6 system