android.view.inputmethod.InputMethodManager#showSoftInputFromInputMethod ( )源码实例Demo

下面列出了android.view.inputmethod.InputMethodManager#showSoftInputFromInputMethod ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

public void hiddenKeybord() {
	InputMethodManager manager = ((InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE));
	if(manager==null){
		return;
	}
	boolean isOpen = manager.isActive(); // 判断软键盘是否打开
	if (isOpen && manager != null) {
		manager.hideSoftInputFromWindow(mEditText.getWindowToken(),InputMethodManager.HIDE_NOT_ALWAYS);
	}else{
		manager.showSoftInputFromInputMethod(mEditText.getWindowToken(), 0);
	}
}
 
源代码2 项目: firebase-android-sdk   文件: CommonUtils.java
public static void openKeyboard(Context context, View view) {
  final InputMethodManager imm =
      (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
  if (imm != null) {
    imm.showSoftInputFromInputMethod(view.getWindowToken(), 0);
  }
}
 
源代码3 项目: o2oa   文件: CommonUtils.java
/**
 * 显示软键盘
 * @param activity
 */
public static void showKeyboard(Activity activity) {
    if (activity != null) {
        InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
        if (!imm.isActive()) {
            imm.showSoftInputFromInputMethod(activity.getCurrentFocus().getWindowToken(), 0);
        }
    }
}
 
源代码4 项目: PlayTogether   文件: ScreenUtils.java
/**
 * 显示软键盘
 */
public static void showKeyboard(Context context)
{
	Activity activity = (Activity) context;
	if (activity != null)
	{
		InputMethodManager imm = (InputMethodManager) activity
						.getSystemService(Context.INPUT_METHOD_SERVICE);
		imm.showSoftInputFromInputMethod(activity.getCurrentFocus()
						.getWindowToken(), 0);
		imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
	}
}
 
源代码5 项目: Stylish-Widget-for-Android   文件: AEditText.java
public void showKeyboard(View view) {
    if (view != null) {
        InputMethodManager imm = (InputMethodManager) getContext()
                .getSystemService(Context.INPUT_METHOD_SERVICE);
        if (imm != null)
            imm.showSoftInputFromInputMethod(view.getWindowToken(), 0);
    }
}
 
源代码6 项目: sealtalk-android   文件: CommonUtils.java
/**
 * 显示软键盘
 * @param activity
 */
public static void showKeyboard(Activity activity) {
	if(activity != null){
		InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
		if(!imm.isActive()){
			imm.showSoftInputFromInputMethod(activity.getCurrentFocus().getWindowToken(), 0);
		}
	}
}
 
源代码7 项目: hackerskeyboard   文件: NotificationReceiver.java
@Override
public void onReceive(Context context, Intent intent) {
    String action = intent.getAction();
    Log.i(TAG, "NotificationReceiver.onReceive called, action=" + action);

    if (action.equals(ACTION_SHOW)) {
        InputMethodManager imm = (InputMethodManager)
            context.getSystemService(Context.INPUT_METHOD_SERVICE);
        if (imm != null) {
            imm.showSoftInputFromInputMethod(mIME.mToken, InputMethodManager.SHOW_FORCED);
        }
    } else if (action.equals(ACTION_SETTINGS)) {
        context.startActivity(new Intent(mIME, LatinIMESettings.class));
    }
}
 
源代码8 项目: EmojiChat   文件: KJChatKeyboard.java
/**
 * 显示软键盘
 */
public static void showKeyboard(Context context) {
    Activity activity = (Activity) context;
    if (activity != null) {
        InputMethodManager imm = (InputMethodManager) activity
                .getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.showSoftInputFromInputMethod(activity.getCurrentFocus()
                .getWindowToken(), 0);
        imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
    }
}
 
源代码9 项目: Utils   文件: SoftInput.java
/**
 * Show the input method's soft input area, so the user sees the input method window and can interact with it.
 * This can only be called from the currently active input method, as validated by the given token.
 *
 * @param view the current focused view
 */
public static void showSoftInputFromInputMethod(View view) {
    if (view != null) {
        Context context = view.getContext();
        IBinder windowToken = view.getWindowToken();
        InputMethodManager inputMethodManager = (InputMethodManager) context
                .getSystemService(Context.INPUT_METHOD_SERVICE);
        inputMethodManager.showSoftInputFromInputMethod(windowToken, 0);
    }
}
 
源代码10 项目: Android-Chat-Widget   文件: MessageInputToolBox.java
/**
 * 显示软键盘
 * @param activity
 */
public static void showKeyboard(Context context) {
	Activity activity = (Activity) context;
	if(activity != null){
		InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
		imm.showSoftInputFromInputMethod(activity.getCurrentFocus().getWindowToken(), 0);
		imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
	}
}
 
源代码11 项目: imsdk-android   文件: RSoftInputLayout.java
public void showSoftInput() {
    InputMethodManager manager = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
    manager.showSoftInputFromInputMethod(getWindowToken(), 0);
}
 
源代码12 项目: ucar-weex-core   文件: AppUtil.java
/**
 * 显示软键盘(根据焦点所在的控件)
 */
public static void showSoftInput(Context c, View foucsView) {
    InputMethodManager imm = (InputMethodManager) c.getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.showSoftInputFromInputMethod(foucsView.getWindowToken(), 0);
}
 
源代码13 项目: letv   文件: CommonUtils.java
public static void openKeyboard(Context context, View view) {
    InputMethodManager imm = (InputMethodManager) context.getSystemService("input_method");
    if (imm != null) {
        imm.showSoftInputFromInputMethod(view.getWindowToken(), 0);
    }
}