Example usage for android.view.inputmethod InputMethodManager showSoftInput

List of usage examples for android.view.inputmethod InputMethodManager showSoftInput

Introduction

In this page you can find the example usage for android.view.inputmethod InputMethodManager showSoftInput.

Prototype

public boolean showSoftInput(View view, int flags) 

Source Link

Document

Synonym for #showSoftInput(View,int,ResultReceiver) without a result receiver: explicitly request that the current input method's soft input area be shown to the user, if needed.

Usage

From source file:com.example.fragment.PrimitiveFragment.java

/** InterFace <----------------------------------------------------------- */
public void up(float destX, float destY) {
    if (mIsAlive) {
        this.mIsAlive = false;
        if (mIsMove) {
            Log.v("--Fragment--", " mIsMove = true");
            setImage(getResources().getDrawable(R.drawable.ss_c_0002), R.drawable.ss_c_0002);
        } else {//from   w w  w.  ja v  a  2  s  .  c o  m
            Log.v("--Fragment--", " mIsMove = false");
            EditText groupTitle = (EditText) mRootView.findViewById(R.id.groupTitle);
            // 3. ????
            groupTitle.setFocusableInTouchMode(true);
            groupTitle.requestFocus();
            InputMethodManager imm = (InputMethodManager) (((MainActivity) getActivity())
                    .getSystemService(Context.INPUT_METHOD_SERVICE));
            imm.showSoftInput(groupTitle, 0);

        }

    }
}

From source file:org.thoughtcrime.securesms.scribbles.widget.MotionView.java

public void startEditing(TextEntity entity) {
    editText.setFocusableInTouchMode(true);
    editText.setFocusable(true);/* w ww .  j ava2 s .c  om*/
    editText.requestFocus();
    editText.setText(entity.getLayer().getText());
    Selection.setSelection(editText.getText(), editText.length());

    InputMethodManager ims = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
    ims.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT);
}

From source file:me.philio.pinentry.PinEntryView.java

@Override
public boolean onTouchEvent(MotionEvent event) {
    if (event.getAction() == MotionEvent.ACTION_DOWN) {
        // Make sure this view is focused
        mEditText.requestFocus();/*from  ww  w . j  av  a 2s .c  om*/

        // Show keyboard
        InputMethodManager inputMethodManager = (InputMethodManager) getContext()
                .getSystemService(Context.INPUT_METHOD_SERVICE);
        inputMethodManager.showSoftInput(mEditText, 0);
        return true;
    }
    return super.onTouchEvent(event);
}

From source file:com.tweetlanes.android.view.ComposeBaseFragment.java

void showKeyboard() {
    InputMethodManager inputMethodManager = (InputMethodManager) getActivity()
            .getSystemService(Context.INPUT_METHOD_SERVICE);
    inputMethodManager.showSoftInput(mEditText, InputMethodManager.SHOW_IMPLICIT);
    //getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
}

From source file:com.shafiq.mytwittle.view.ComposeBaseFragment.java

void showKeyboard() {
    InputMethodManager inputMethodManager = (InputMethodManager) getActivity()
            .getSystemService(Context.INPUT_METHOD_SERVICE);
    inputMethodManager.showSoftInput(mEditText, InputMethodManager.SHOW_IMPLICIT);
}

From source file:com.watasan.infospider.fragment.PrimitiveFragment.java

/** InterFace <----------------------------------------------------------- */
public void up(float destX, float destY) {
    if (mIsAlive) {
        this.mIsAlive = false;
        if (mIsMove) {
            Log.v("--Fragment--", " mIsMove = true");
            //               setImage(getResources().getDrawable(R.drawable.ss_c_0002));
        } else {/*from www  .  ja v  a  2  s . c  o m*/
            Log.v("--Fragment--", " mIsMove = false");
            EditText groupTitle = (EditText) mRootView.findViewById(R.id.groupTitle);
            // 3. ????
            groupTitle.setFocusableInTouchMode(true);
            groupTitle.requestFocus();
            InputMethodManager imm = (InputMethodManager) (((MainActivity) getActivity())
                    .getSystemService(Context.INPUT_METHOD_SERVICE));
            imm.showSoftInput(groupTitle, 0);

        }

    }
}

From source file:com.alimuzaffar.lib.widgets.PinEntryEditText.java

public void focus() {
    requestFocus();//from  w  w w .j  a va2s .  c o  m

    // Show keyboard
    InputMethodManager inputMethodManager = (InputMethodManager) getContext()
            .getSystemService(Context.INPUT_METHOD_SERVICE);
    inputMethodManager.showSoftInput(this, 0);
}

From source file:com.amazon.android.tv.tenfoot.ui.fragments.ContentSearchFragment.java

@Override
public void onResume() {

    super.onResume();

    if (!mHasResults) {
        mAutoTextViewFocusHandler.postDelayed(() -> {

            if (mSearchEditText != null) {

                // Select search edit text, bring up keyboard.
                // Always make SpeechOrb not focusable, leanback always tries to bring it back.
                mSearchEditText.setFocusable(true);
                mSearchEditText.requestFocus();
                mSpeechOrbView.setFocusable(false);
                InputMethodManager imm = (InputMethodManager) getActivity()
                        .getSystemService(Context.INPUT_METHOD_SERVICE);
                if (imm != null) {
                    imm.showSoftInput(mSearchEditText, 0);
                }//from w  w  w . j a v a 2 s  .  c  om
            }
            // There must be a delay to allow SearchOrb to initialize, otherwise no search
            // results will come back from leanback.
        }, 1000);
    }
}

From source file:com.eutectoid.dosomething.picker.PlacePickerFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);

    if (searchBox != null) {
        InputMethodManager imm = (InputMethodManager) getActivity()
                .getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.showSoftInput(searchBox, InputMethodManager.SHOW_IMPLICIT);
    }/* w  w w.  j a  va  2 s . c  o m*/
}

From source file:com.z299studio.pb.HomeActivity.java

private void popInput() {
    if (mPwdEdit != null) {
        mPwdEdit.postDelayed(new Runnable() {
            @Override//from  w ww. ja va  2  s .c  o m
            public void run() {
                mPwdEdit.requestFocus();
                InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
                imm.showSoftInput(mPwdEdit, InputMethodManager.SHOW_FORCED);
            }
        }, 100);

        OnEditorActionListener eal = new OnEditorActionListener() {
            @Override
            public boolean onEditorAction(TextView edit, int id, KeyEvent event) {
                if (id == EditorInfo.IME_ACTION_DONE) {
                    onConfirm(null);
                    return true;
                }
                return false;
            }
        };
        EditText et_confirm = (EditText) findViewById(R.id.confirm);
        if (et_confirm.getVisibility() == View.VISIBLE) {
            mPwdEdit.setImeOptions(EditorInfo.IME_ACTION_NEXT);
            et_confirm.setOnEditorActionListener(eal);
        } else {
            mPwdEdit.setOnEditorActionListener(eal);
        }
    }
}