1
<Key android:codes="???" android:keyLabel="e" android:keyHeight= "7%p" android:horizontalGap=".85%p" android:keyWidth= "8%p"/>

I have a key on my custom keyboard but I want open up a new window when it is pressed that displays a list of options. For example, the new window would display a list of quotes that when pressed, it would type it out for you. I was thinking about putting a case in the OnKey method to listen to a code but I'm not sure which code I should use. Also, should the new window be an Activity?

JasonDD
  • 23
  • 3

1 Answers1

1
emailAddressEt.setImeOptions(EditorInfo.IME_ACTION_DONE);
        emailAddressEt.setOnEditorActionListener(new OnEditorActionListener() {
            @Override
            public boolean onEditorAction(TextView v, int actionId,KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE) {
            Intent intent = new Intent(this,NewActivity.class);
startActivity(intent);
                }
                return false;
            }
        });
Rohit Heera
  • 2,709
  • 2
  • 21
  • 31