Example usage for android.view.inputmethod InputMethodManager RESULT_UNCHANGED_SHOWN

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

Introduction

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

Prototype

int RESULT_UNCHANGED_SHOWN

To view the source code for android.view.inputmethod InputMethodManager RESULT_UNCHANGED_SHOWN.

Click Source Link

Document

Flag for the ResultReceiver result code from #showSoftInput(View,int,ResultReceiver) and #hideSoftInputFromWindow(IBinder,int,ResultReceiver) : the state of the soft input window was unchanged and remains shown.

Usage

From source file:Main.java

public static void showSoftInput(Context context) {
    InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.toggleSoftInput(InputMethodManager.RESULT_UNCHANGED_SHOWN, InputMethodManager.HIDE_NOT_ALWAYS);
}

From source file:Main.java

public static void closeSoftInput(Context context, View focusingView) {
    InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.hideSoftInputFromWindow(focusingView.getWindowToken(), InputMethodManager.RESULT_UNCHANGED_SHOWN);
}

From source file:Main.java

public static void showSoftKeyPad(Context context, View view) {
    try {//from  w w  w .jav  a2  s.com
        InputMethodManager inputManager = (InputMethodManager) context
                .getSystemService(Context.INPUT_METHOD_SERVICE);
        inputManager.showSoftInput(view, InputMethodManager.RESULT_UNCHANGED_SHOWN);
    } catch (Throwable ex) {
    }
}

From source file:Main.java

public static void closeKeyboard(EditText view) {
    view.clearFocus();/*from  ww  w  . j a v  a 2s  .c om*/
    InputMethodManager imm = (InputMethodManager) view.getContext()
            .getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.RESULT_UNCHANGED_SHOWN);
}

From source file:Main.java

public static void showSoftInput(Activity acitivity, EditText et) {
    if (et == null)
        return;//w w w.  j av  a2  s  .c o m
    et.requestFocus();
    InputMethodManager imm = (InputMethodManager) et.getContext()
            .getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.showSoftInput(et, InputMethodManager.RESULT_UNCHANGED_SHOWN);

}

From source file:Main.java

/**
 * Explicitly request that the current input method's soft input area be
 * shown to the user, if needed.//from   www. j a  v a  2 s  . c om
 * 
 * @param view
 *            The currently focused view, which would like to receive soft
 *            keyboard input.
 */
public static void showKeyboard(View view) {
    view.requestFocus();
    InputMethodManager imm = (InputMethodManager) view.getContext()
            .getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.showSoftInput(view, InputMethodManager.RESULT_UNCHANGED_SHOWN);
}

From source file:Main.java

/**
 * Request to hide the soft input window from the context of the window that
 * is currently accepting input./*from w w w .  j a  v a 2  s .  c o m*/
 * 
 * @param activity
 *            The currently activity, which shows the view receives soft
 *            keyboard input
 */
public static void showKeyboard(Activity activity) {
    if (null == activity) {
        return;
    }
    InputMethodManager im = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
    View v = activity.getCurrentFocus();
    if (v != null) {
        im.showSoftInput(v, InputMethodManager.RESULT_UNCHANGED_SHOWN);
    }
}

From source file:com.mifos.mifosxdroid.core.MifosBaseFragment.java

public void hideKeyboard(View view) {
    inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.RESULT_UNCHANGED_SHOWN);
}

From source file:net.named_data.nfd.PingClientFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View v = inflater.inflate(R.layout.fragment_ping_client, container, false);

    // Get UI Elements
    m_pingResultListView = (ListView) v.findViewById(R.id.pingResult);

    m_pingNameEditText = (EditText) v.findViewById(R.id.pingName);
    m_pingStartButton = (Button) v.findViewById(R.id.pingStart);
    m_pingStartButton.setOnClickListener(new View.OnClickListener() {
        @Override//from   w ww .  ja  v  a  2 s. c o  m
        public void onClick(View v) {
            InputMethodManager imm = (InputMethodManager) getActivity()
                    .getSystemService(Context.INPUT_METHOD_SERVICE);
            imm.hideSoftInputFromWindow(m_pingNameEditText.getWindowToken(),
                    InputMethodManager.RESULT_UNCHANGED_SHOWN);
            if (m_isStartState) {
                setButtonState(false);
                String pingPrefix = m_pingNameEditText.getText().toString();

                m_pingResultListAdapter.clearMessages();
                m_pingResultListAdapter.addMessage("PING " + pingPrefix);
                m_pingResultListView.setSelection(m_pingResultListAdapter.getCount() - 1);

                m_client = new PingClient(pingPrefix);
                m_client.setListener(PingClientFragment.this);
                m_client.start();
            } else {
                setButtonState(true);
                if (m_client != null) {
                    m_client.stop();
                }
            }
        }
    });

    return v;
}

From source file:com.mifos.mifosxdroid.core.MifosBaseActivity.java

public void hideKeyboard(View view) {
    InputMethodManager inputManager = (InputMethodManager) this.getSystemService(Context.INPUT_METHOD_SERVICE);
    inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.RESULT_UNCHANGED_SHOWN);
}