안드로이드 개발 질문/답변
(글 수 45,052)
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<EditText android:text=""
android:id="@+id/test1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
></EditText>
<EditText android:text=""
android:id="@+id/test2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
></EditText>
</LinearLayout>
첫번째 EditText 클릭하면 키보드 나오는데 입력다하면 포커스가 2번째 EditText 로 이동하면서 키보드는 그대로 올라와있네요
첫번째EditText 입력끝나면 키보드 네려가고 2번째 EditText 클릭했을때 다시 키보드 올라오게 하는 방법좀 알려주세요
그러니깐 포커스 자동이동 안되게 하는 방법좀 알려주세요
삽질만 하고있네요 ㅡㅜ




edit1.setOnFocusChangeListener(new OnFocusChangeListener()
{
@Override
public void onFocusChange(View v, boolean hasFocus) {
// TODO Auto-generated method stub
if(v == edit1 && !hasFocus)
{
hideSoftKeyboard(SendSMSTestActivity.this, edit1);
}
}
});
public static void hideSoftKeyboard(Activity act, View view) {
InputMethodManager mgr = (InputMethodManager) act.getSystemService(Context.INPUT_METHOD_SERVICE);
mgr.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
포커스가 변경될때 체크해서 키보드 내리는 식으로 하니까 되는거 같은데 이게 원하시는건지 모르겠네요..ㅋ;;