ボタンを同時に押せてしまうと処理が複雑になりとても不便です。そこで、同時に2つ以上のボタンを押しても初めに押されたボタンの処理だけを実行する方法を紹介します。 初めにタッチした指を検出する ViewGroup(LinearLayout, FrameLayoutなど)にはsplitMotionEventsという属性があります。この属性にfalseを指定することで、そのViewGroup内のボタンのMotionEventを一括で検出できます。 <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:splitMotionEvents="false"> <Button android:id="@+id/button1" android:layout_width="