annoying toast keeps showing how to stop it
<p>Every time I pressed enter the toast keeps popping out even if it should not come out...</p>

<p>take a lot at my code:</p>

<pre><code>etAddMove.setOnKeyListener(new OnKeyListener() {

            @SuppressLint("NewApi")
            public boolean onKey(View v, int keyCode, KeyEvent event) {
                // TODO Auto-generated method stub
                if(keyCode == KeyEvent.KEYCODE_ENTER &amp;&amp; event.getRepeatCount() == 0){
                    String ssmoveName = etAddMove.getText().toString();
                    int x = ssmoveName.length() - 1;
                    if (ssmoveName.isEmpty() || Character.isWhitespace(ssmoveName.charAt(0)) || Character.isWhitespace(ssmoveName.charAt(x))) {
                        Toast.makeText(ListMovingNames.this, 
                                "Please enter a valid name! Avoid giving a blank name or white space at the beginning or end of the name", 
                                Toast.LENGTH_LONG).show();
                    }else{
                        try {
                            SQLHandler check = new SQLHandler(ListMovingNames.this);
                            check.open();
                            String scheck = check.checkMove(ssmoveName);
                            check.close();
                            if (!scheck.equals(ssmoveName)) {
                                Toast.makeText(ListMovingNames.this, "Move name already exist please give a different name", Toast.LENGTH_LONG).show();
                            } else{
                                SQLHandler entry = new SQLHandler(ListMovingNames.this);
                                entry.open();
                                entry.createMove(ssmoveName);
                                entry.setTodo(ssmoveName);
                                entry.close();
                                Intent i = new Intent(getApplicationContext(), StartMoving.class);
                                i.putExtra("moveName", ssmoveName);
                                startActivity(i);
                            }
                        } catch (Exception e) {
                            // TODO Auto-generated catch block
                            SQLHandler entry = new SQLHandler(ListMovingNames.this);
                            entry.open();
                            entry.createMove(ssmoveName);
                            entry.setTodo(ssmoveName);
                            entry.close();
                            Intent i = new Intent(getApplicationContext(), StartMoving.class);
                            i.putExtra("moveName", ssmoveName);
                            startActivity(i);
                        }
                    }
                    return true;
                }

                return onKeyDown(keyCode, event);
            }
        });
</code></pre>

<p>how can you make this guy stop if I don't want it to show...</p>

<p><strong>EDIT</strong></p>

<p>I think I know why this is happening, It must be because each time i press enter keyup and keydown is initialize thats why the first initialization is keydown which calls the condition and returns false and when keydown is called the condition is called again which will return true, making the toast display. thats what i think so far...</p>
