2017-03-08 1 views
0

悪い英語のおかげで、 私はカスタムキーボードを表示するテキストフィールドを編集しました。初めてのクリックでそれはカスタムキーボードを示していますが、私は再びそのフィールドをクリックした場合、それは私のコードデバイスのデフォルトのキーボードを示しクリックしてテキストフィールドを編集します。もう一度デフォルトのキーボードが表示されます

final EditTextNoKeyBoard eText = new EditTextNoKeyBoard(context); 
         eText.setBackgroundResource(R.drawable.edit_text_border); 
         eText.setTextColor(context.getResources().getColor(R.color.appInputTextColor)); 
//      eText.setGravity(Gravity.CENTER_HORIZONTAL); 
//      eText.setFocusableInTouchMode(true); 
         eText.setRawInputType(InputType.TYPE_CLASS_TEXT); 
         eText.setInputType(0); 
         eText.setTextIsSelectable(true); 
         eText.setWidth(100); 
         eText.setSingleLine(); 

EditTextNoKeyBoardクラスは、エディットテキストフォーカスオン

public class EditTextNoKeyBoard extends EditText 
{ 

    public EditTextNoKeyBoard(Context context) 
    { 
     super(context); 
    } 

    public EditTextNoKeyBoard(Context context, AttributeSet attrs, int defStyle) 
    { 
     super(context, attrs, defStyle); 
    } 

    public EditTextNoKeyBoard(Context context, AttributeSet attrs) 
    { 
     super(context, attrs); 
    } 

    @Override 
    public boolean onCheckIsTextEditor() 
    { 
     return true; 
    } 
} 
+0

@Sanjay Chauhan私はこれを試しましたが、すべてが無駄です –

答えて

0

ですされているシステムのキーボード

を隠します
View view = this.getCurrentFocus(); 
if (view != null) { 
    InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); 
    imm.hideSoftInputFromWindow(view.getWindowToken(), 0); 
} 
+0

私はこのソリューションをテストしましたが、これは私のためには機能しません –

関連する問題