List of usage examples for android.view.inputmethod InputMethodManager SHOW_IMPLICIT
int SHOW_IMPLICIT
To view the source code for android.view.inputmethod InputMethodManager SHOW_IMPLICIT.
Click Source Link
From source file:de.baumann.quitsmoking.helper.helper_main.java
public static void showKeyboard(Activity from, EditText editText) { InputMethodManager imm = (InputMethodManager) from.getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT); editText.setSelection(editText.length()); }
From source file:com.simplaapliko.trips.presentation.fragment.BaseFragment.java
protected void showKeyboard(SearchView view) { view.requestFocus();/* w ww.j a v a 2s . c om*/ InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, InputMethodManager.HIDE_IMPLICIT_ONLY); }
From source file:edu.rowan.app.fragments.FoodCommentFragment.java
public void onStart() { super.onStart(); InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, 0); }
From source file:eu.basicairdata.graziano.gpslogger.FragmentPlacemarkDialog.java
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder createPlacemarkAlert = new AlertDialog.Builder(getActivity(), R.style.StyledDialog); createPlacemarkAlert.setTitle(R.string.dlg_add_placemark); createPlacemarkAlert.setIcon(R.mipmap.ic_add_location_white_24dp); LayoutInflater inflater = getActivity().getLayoutInflater(); final View view = (View) inflater.inflate(R.layout.fragment_placemark_dialog, null); DescEditText = (EditText) view.findViewById(R.id.placemark_description); DescEditText.postDelayed(new Runnable() { public void run() { if (isAdded()) { DescEditText.requestFocus(); InputMethodManager mgr = (InputMethodManager) getActivity() .getSystemService(Context.INPUT_METHOD_SERVICE); mgr.showSoftInput(DescEditText, InputMethodManager.SHOW_IMPLICIT); }/*from w w w . j a v a 2s. c o m*/ } }, 200); createPlacemarkAlert.setView(view) //.setPositiveButton(R.string.conti_nue, new DialogInterface.OnClickListener() { .setPositiveButton(R.string.dlg_button_add, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { if (isAdded()) { String PlacemarkDescription = DescEditText.getText().toString(); final GPSApplication GlobalVariables = (GPSApplication) getActivity() .getApplicationContext(); GlobalVariables.setPlacemarkDescription(PlacemarkDescription.trim()); EventBus.getDefault().post(EventBusMSG.ADD_PLACEMARK); //Log.w("myApp", "[#] FragmentPlacemarkDialog.java - posted ADD_PLACEMARK: " + PlacemarkDescription); } } }) //.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { .setNegativeButton(R.string.dlg_button_cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { } }); return createPlacemarkAlert.create(); }
From source file:com.raspi.chatapp.ui.password.PinFragment.java
@Override public void onResume() { super.onResume(); EditText pin = (EditText) getView().findViewById(R.id.pin); // always focus the pinEditText pin.setFocusableInTouchMode(true);/*from www. j a v a2s. co m*/ pin.requestFocus(); InputMethodManager inputMethodManager = (InputMethodManager) getActivity() .getSystemService(Context.INPUT_METHOD_SERVICE); inputMethodManager.showSoftInput(pin, InputMethodManager.SHOW_IMPLICIT); pin.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { // if the text reached a length of 4 chars check the password and // clear the editText if (s.length() == 4) { char[] pwd = new char[4]; s.getChars(0, 4, pwd, 0); mListener.onPasswordEntered(pwd); s.clear(); // otherwise make sure that the invalid pwd textView is gone } else getView().findViewById(R.id.password_invalid).setVisibility(View.GONE); } }); }
From source file:dev.drsoran.moloko.util.UIUtils.java
public final static void showSoftInput(View view) { if (view != null) { final InputMethodManager imm = (InputMethodManager) view.getContext() .getSystemService(Context.INPUT_METHOD_SERVICE); if (imm != null) { imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT); }// ww w.ja v a2s.c o m } }
From source file:com.domowe.apki.lista2.Utils.java
public static void showKeyboard(Context context, EditText editText) { editText.requestFocus();/*from ww w.j av a2s .co m*/ InputMethodManager inputMethodManager = (InputMethodManager) context .getSystemService(Context.INPUT_METHOD_SERVICE); inputMethodManager.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT); }
From source file:ch.jeda.platform.android.InputDialogFragment.java
@Override public Dialog onCreateDialog(final Bundle savedInstanceState) { final AlertDialog.Builder builder = new AlertDialog.Builder(this.getActivity()); builder.setTitle(this.request.getTitle()); builder.setMessage(this.request.getMessage()); this.input = new EditText(this.getActivity()); // This is required in order to show soft keyboard when input is focused. this.input.setFocusableInTouchMode(true); this.input.setImeOptions(EditorInfo.IME_ACTION_DONE); this.input.setInputType(EditorInfo.TYPE_CLASS_TEXT); this.input.addTextChangedListener(this); final InputMethodManager imm = (InputMethodManager) getActivity() .getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(this.input, InputMethodManager.SHOW_IMPLICIT); builder.setView(this.input); builder.setPositiveButton("OK", this); builder.setNegativeButton("Abbrechen", this); return builder.create(); }
From source file:nl.eduvpn.app.fragment.CustomProviderFragment.java
@Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); // Put the cursor in the field and show the keyboard automatically. _customProviderUrl.requestFocus();/*from w w w.j ava 2s . com*/ InputMethodManager inputMethodManager = (InputMethodManager) getActivity() .getSystemService(Context.INPUT_METHOD_SERVICE); if (inputMethodManager != null) { inputMethodManager.showSoftInput(_customProviderUrl, InputMethodManager.SHOW_IMPLICIT); } }
From source file:ng.uavp.ch.ngusbterminal.ShellFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View view = inflater.inflate(R.layout.shell, container, false); terminalView = (TerminalEditText) view.findViewById(R.id.editText1); terminalView.HookSerialDevice(serial); recvHandler = new Handler(Looper.getMainLooper()) { @Override/*w w w . j av a 2 s . com*/ public void handleMessage(Message inputMessage) { byte[] receivedData = (byte[]) inputMessage.obj; terminalView.OnReceived(receivedData); } }; if (terminalView.requestFocus()) { InputMethodManager imm = (InputMethodManager) getActivity() .getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(terminalView, InputMethodManager.SHOW_IMPLICIT); } return view; }