I recommend that you use Custom Dialog to do this.
The fact is that you want the keyboard to interact and return when a number is pressed, right?
If you need an example, you can create a dialog action like:
public class Keypad extends Dialog protected static final String TAG = "Keypad" ; private final View keys[] = new View[9]; private View keypad; private int tecla = 0;
Then set this content on creation:
setContentView(R.layout.keypad); findViews(); setListeners();
Find species will be something like this:
keypad = findViewById(R.id.keypad); keys[0] = findViewById(R.id.keypad_1); ...
And the XML dialog should have a table:
<TableRow> <Button android:id="@+id/keypad_1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="keypadClick" android:text="keypadClick"></Button> <Button android:id="@+id/keypad_2" android:text="2" > </Button> <Button android:id="@+id/keypad_3" android:text="3" > </Button> </TableRow> ... Etc
So, when you start the dialogue, you will see a menu with 9 numbers (in my case), which are fired when 1 of them is clicked, and cancel the dialogue (return to the point where the throw was)
I hope this helps!
source share