Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 일치단결
- nextFocusDown
- Chat GPT
- XML Opacity
- php
- Linux 패키지 관리자
- 3차 소환조사
- Android Studio
- 챗GPT
- 챗지피티
- 친트럼프
- Github 등록
- Location Permission
- TextView 일부분
- codeigniter
- Execution failed for task ':test'.
- 여러 개
- InvalidTestClassError
- git
- Github Token
- mac 패키지 관리자
- PHP Storm
- git cannot identify version of git executable
- sourceSet
- AWS
- 5회 인증
- MySQL
- 다음으로 이동
- 흉기살해
- junit
Archives
- Today
- Total
128june
[Android Studio] 소프트 키패드 다음/완료/로그인/키패드 없애기 동작 수행 본문
반응형
다음
android:nextFocusDown="@+id/다음 나올 id"
완료 : xml에서 inputType을 설정해주면 자동으로 완료가 됨
android:inputType="number"
로그인 동작
먼저 setImeOptions를 설정한 후 onEditorAction을 설정
"EditText 변수".setImeOptions(EditorInfo.IME_ACTION_DONE);
"EditText 변수".setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if(actionId == EditorInfo.IME_ACTION_DONE) {
Toast.makeText(getApplicationContext(),"로그인 성공",Toast.LENGTH_SHORT).show();
return true;
}
return false;
}
});
완료 누르면 키패드 없애기
public static void keyHide(Context ctx, EditText view) {
InputMethodManager imm = (InputMethodManager) ctx.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
"EditText 변수".setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if(actionId == EditorInfo.IME_ACTION_DONE) {
keyHide("현재 파일".this, "EditText 변수");
return true;
}
return false;
}
});
반응형
'개발 > Android Studio' 카테고리의 다른 글
| [Android Studio] "Caused by: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation" 오류 해결방안 (0) | 2020.09.15 |
|---|---|
| [Android Studio] activity 시작 시 editText 자동 포커싱 막기 (0) | 2020.09.15 |
| [Android Studio] GridView Item 범위 선택하기 (0) | 2020.07.30 |
| [Android Studio] 둥근 도형 만들기 ( Shape Drawable ) (0) | 2020.07.29 |
| [Android Studio] Toast 활용 ( 간단하게 정리 ) (0) | 2020.07.28 |
Comments