EditText IMEキーボードでGOボタンを表示して処理

Android EditText で出すIMEキー入力で、文字を入れたら以下のように、
「GO」ボタンを表示して機能させるには、、、、


まず、レイアウトXMLEditText では、
  android:imeOptions="actionGo"
を付与する。

<EditText
    android:id="@+id/urlEditText"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/urlframe"
    android:layout_marginLeft="4dp"
    android:layout_marginRight="4dp"
    android:layout_marginTop="2dp"
    android:layout_marginBottom="2dp"
    android:paddingTop="8dp"
    android:paddingBottom="8dp"
    android:textSize="6pt"
    android:inputType="textUri"
    android:imeOptions="actionGo" >
           <requestFocus />
</EditText>


これだけだど、ただ「GO」ボタンが表示されるだけなので、GOボタンを押した時の処理を
以下のように用意する。

EditText urlEditText = (EditText)findViewById(R.id.urlEditText);

urlEditText.setOnEditorActionListener(new TextView.OnEditorActionListener(){
   @Override
   public boolean onEditorAction(TextView v,int actionId,KeyEvent event){

      if (actionId == EditorInfo.IME_ACTION_GO){
         webview.loadUrl(urlEditText.getText().toString());
         return true;
      }

      return false;
   }
});