当前位置:网站首页>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边栏推荐
- [combinatorics] combinatorial identity (sum of variable upper terms 1 combinatorial identity | summary of three combinatorial identity proof methods | proof of sum of variable upper terms 1 combinator
- Unityshader - materialcapture material capture effect (Emerald axe)
- The difference between mutually exclusive objects and critical areas
- ASEMI整流桥UMB10F参数,UMB10F规格,UMB10F封装
- Microservice - fuse hystrix
- Colab works with Google cloud disk
- App mobile terminal test [5] file writing and reading
- Function introduction of JMeter thread group
- CString中使用百分号
- 一些事情的反思
猜你喜欢

Please be prepared to lose your job at any time within 3 years?

Redis installation under windows and Linux systems

Intelij idea efficient skills (III)

Distributed task scheduling XXL job

The difference between calling by value and simulating calling by reference

Creation and destruction of function stack frames

From "zero sum game" to "positive sum game", PAAS triggered the third wave of cloud computing

VS2017通过IP调试驱动(双机调试)
![[系统安全] 四十三.Powershell恶意代码检测系列 (5)抽象语法树自动提取万字详解](/img/cd/00954b9c592c253d42e6a3b8298999.jpg)
[系统安全] 四十三.Powershell恶意代码检测系列 (5)抽象语法树自动提取万字详解

ASEMI整流桥UMB10F参数,UMB10F规格,UMB10F封装
随机推荐
Go语言自学系列 | golang中的if else语句
Break through 1million, sword finger 2million!
高等数学(第七版)同济大学 习题2-1 个人解答
【OpenCV 例程200篇】217. 鼠标交互获取多边形区域(ROI)
[list to map] collectors Tomap syntax sharing (case practice)
Go language self-study series | if else statement in golang
Go语言自学系列 | golang中的if else if语句
[proteus simulation] 74hc595+74ls154 drive display 16x16 dot matrix
The difference between RAR and zip files
uploads-labs靶场(附源码分析)(更新中)
C language brush questions ~leetcode and simple questions of niuke.com
SDNU_ ACM_ ICPC_ 2022_ Winter_ Practice_ 4th [individual]
About text selection in web pages and counting the length of selected text
Famous blackmail software stops operation and releases decryption keys. Most hospital IOT devices have security vulnerabilities | global network security hotspot on February 14
Brush questions -- sword finger offer
First!! Is lancet hungry? Official documents
App移动端测试【4】apk的操纵
Subclass hides the function with the same name of the parent class
初试scikit-learn库
“用Android复刻Apple产品UI”(3)—优雅的数据统计图表