3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Androidアプリ制作で入力後に次の入力欄へ

Posted at

やりたいこと

EditViewで入力すると、キーボードの所に「次へ」と出る。
これを押したときに、ちゃんと次の入力欄へフォーカスを移動させたい。

コード

レイアウトXMLファイルのEditTextに、android:nextFocusForward="@+id/editSecond"android:imeOptions="actionNext"を追加する。
当然、IDは適宜修正で。

<EditText
    android:id="@+id/editFirst"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:inputType="text"
    android:text=""
    android:nextFocusForward="@+id/editSecond"
    android:imeOptions="actionNext"
    android:textSize="24sp" />
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?